signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class NDArrayIndex { /** * Add indexes for the given shape * @ param shape the shape ot convert to indexes * @ return the indexes for the given shape */ public static INDArrayIndex [ ] indexesFor ( long ... shape ) { } }
INDArrayIndex [ ] ret = new INDArrayIndex [ shape . length ] ; for ( int i = 0 ; i < shape . length ; i ++ ) { ret [ i ] = NDArrayIndex . point ( shape [ i ] ) ; } return ret ;
public class JsonService { private static void checkArguments ( JSONObject jsonObject , String key ) throws JSONException { } }
if ( key == null ) { throw new IllegalArgumentException ( "Can't go searching for a null key." ) ; } if ( jsonObject == null ) { throw new JSONException ( "Can't search for key '" + key + "' in a null object." ) ; } if ( ! jsonObject . containsKey ( key ) ) { throw new JSONException ( "Key '" + key + "' could not be fo...
public class SimpleKeyComponent { @ Override public ColumnBinding createReferenceBinding ( Facet referencingFacet , NamingStrategy strategy ) { } }
SubFacet sub = new SubFacet ( referencingFacet , getFacet ( ) , false ) ; return new SimpleFacetBinding ( sub , strategy . getColumnName ( sub ) , getConverter ( ) ) ;
public class Loader { /** * Handle the sequence with its screen until no more sequence to run . * @ param config The configuration used . * @ param sequenceClass The the next sequence to start . * @ param arguments The sequence arguments list if needed by its constructor . * @ throws LionEngineException If an e...
final Screen screen = Graphics . createScreen ( config ) ; try { screen . start ( ) ; screen . awaitReady ( ) ; final Context context = new ContextWrapper ( screen ) ; Sequencable nextSequence = UtilSequence . create ( sequenceClass , context , arguments ) ; while ( nextSequence != null ) { final Sequencable sequence =...
public class DefaultFastFileStorageClient { /** * 删除文件 */ @ Override public void deleteFile ( String filePath ) { } }
StorePath storePath = StorePath . parseFromUrl ( filePath ) ; super . deleteFile ( storePath . getGroup ( ) , storePath . getPath ( ) ) ;
public class MyX509TrustManager { /** * Delegate to the default trust manager . */ public void checkServerTrusted ( X509Certificate [ ] chain , String authType ) throws CertificateException { } }
try { pkixTrustManager . checkServerTrusted ( chain , authType ) ; } catch ( CertificateException excep ) { /* * Possibly pop up a dialog box asking whether to trust the * cert chain . */ }
public class BitsUtil { /** * Set bit number " off " in v . * Low - endian layout for the array . * @ param v Buffer * @ param off Offset to set */ public static long [ ] setI ( long [ ] v , int off ) { } }
final int wordindex = off >>> LONG_LOG2_SIZE ; v [ wordindex ] |= ( 1L << off ) ; return v ;
public class snmp_view { /** * < pre > * Use this operation to get SNMP View details . * < / pre > */ public static snmp_view [ ] get ( nitro_service client ) throws Exception { } }
snmp_view resource = new snmp_view ( ) ; resource . validate ( "get" ) ; return ( snmp_view [ ] ) resource . get_resources ( client ) ;
public class BigComplex { /** * Calculates the addition of the given complex value to this complex number . * < p > This methods < strong > does not < / strong > modify this instance . < / p > * @ param value the { @ link BigComplex } value to add * @ return the calculated { @ link BigComplex } result */ public B...
return valueOf ( re . add ( value . re ) , im . add ( value . im ) ) ;
public class MappedBytes { /** * Allocates a mapped buffer in { @ link java . nio . channels . FileChannel . MapMode # READ _ WRITE } mode . * Memory will be mapped by opening and expanding the given { @ link java . io . File } to the desired { @ code count } and mapping the * file contents into memory via { @ link...
return allocate ( file , FileChannel . MapMode . READ_WRITE , size ) ;
public class AbstractCheckedFuture { /** * { @ inheritDoc } * < p > This implementation calls { @ link # get ( ) } and maps that method ' s standard * exceptions to instances of type { @ code X } using { @ link # mapException } . * < p > In addition , if { @ code get } throws an { @ link InterruptedException } , ...
try { return get ( ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw mapException ( e ) ; } catch ( CancellationException e ) { throw mapException ( e ) ; } catch ( ExecutionException e ) { throw mapException ( e ) ; }
public class WorkStealingQueue { /** * Executes the given task in the future . * Queues the task and notifies the waiting thread . Also it makes * the Work assigner to wait if the queued task reaches to threshold */ @ SuppressWarnings ( "unchecked" ) public boolean execute ( Runnable r ) { } }
try { queue [ queue_no ++ % nThreads ] . putFirst ( r ) ; if ( queue_no == nThreads ) { queue_no = 0 ; } return true ; } catch ( InterruptedException e ) { String info = "Failed to enqueue task: " ; Throwable baseCause = org . gautelis . vopn . lang . Stacktrace . getBaseCause ( e ) ; info += baseCause . getMessage ( )...
public class LanguageAlchemyEntity { /** * Set number of persons who natively speak the detected language . * Based on the wikipedia page there will be no fewer than 1 million speakers . * Based on results from calling the alchemy api this will be a string in the * format : * 6.45 million * 105 million * 30...
if ( numberOfNativeSpeakers != null ) { numberOfNativeSpeakers = numberOfNativeSpeakers . trim ( ) ; } this . numberOfNativeSpeakers = numberOfNativeSpeakers ; setMinimumNumberOfNativeSpeakers ( NumberUtil . minimumFromRange ( numberOfNativeSpeakers ) ) ; setMaximumNumberOfNativeSpeakers ( NumberUtil . maximumFromRange...
public class BingVideosImpl { /** * The Video Search API lets you send a search query to Bing and get back a list of videos that are relevant to the search query . This section provides technical details about the query parameters and headers that you use to request videos and the JSON response objects that contain the...
return searchWithServiceResponseAsync ( query , searchOptionalParameter ) . map ( new Func1 < ServiceResponse < VideosModel > , VideosModel > ( ) { @ Override public VideosModel call ( ServiceResponse < VideosModel > response ) { return response . body ( ) ; } } ) ;
public class OptionInjector { /** * Invokes the methodss annotated with { @ link PostInject } on the target and its injected option . * @ param target * the target to invoke the post inject methods * @ param < T > */ private < T > void preFlightCheck ( final T target ) { } }
if ( target == null ) { return ; } preFlightCheckFields ( target ) ; final List < Method > methods = getPostInjectMethods ( target ) ; preFlightCheckMethods ( target , methods ) ;
public class EventHandler { /** * Push an event with a set of attribute pairs . * @ param eventName The name of the event * @ param eventActions A { @ link HashMap } , with keys as strings , and values as { @ link String } , * { @ link Integer } , { @ link Long } , { @ link Boolean } , { @ link Float } , { @ link...
CleverTapAPI cleverTapAPI = weakReference . get ( ) ; if ( cleverTapAPI == null ) { Logger . d ( "CleverTap Instance is null." ) ; } else { cleverTapAPI . pushEvent ( eventName , eventActions ) ; }
public class AbstractIoBuffer { /** * { @ inheritDoc } */ @ Override public < E extends Enum < E > > E getEnumShort ( Class < E > enumClass ) { } }
return toEnum ( enumClass , getUnsignedShort ( ) ) ;
public class NumberListBuilder { /** * but I ' m going to rely on the user to not do anything silly */ private Object toActualNumber ( Double value , Type type ) { } }
if ( type . equals ( Byte . class ) ) return value . byteValue ( ) ; if ( type . equals ( Short . class ) ) return value . shortValue ( ) ; if ( type . equals ( Integer . class ) ) return value . intValue ( ) ; if ( type . equals ( Long . class ) ) return value . longValue ( ) ; if ( type . equals ( Float . class ) ) r...
public class RunFromFileSystemModel { /** * Gets properties . * @ param envVars the env vars * @ return the properties */ @ Nullable public Properties getProperties ( EnvVars envVars , VariableResolver < String > varResolver ) { } }
return createProperties ( envVars , varResolver ) ;
public class Component { /** * Finds the nearest ancestor of this component stack . * @ param clazz * the class to look for , or if assignable from . * @ return the component if found , < tt > null < / tt > if not . */ @ SuppressWarnings ( "unchecked" ) protected < T extends Component > T findAncestor ( Class < T...
Stack < ? extends Component > componentStack = getComponentStack ( ) ; for ( int i = componentStack . size ( ) - 2 ; i >= 0 ; i -- ) { Component component = componentStack . get ( i ) ; if ( clazz . equals ( component . getClass ( ) ) ) return ( T ) component ; } return null ;
public class GatewayClient { /** * Reads a publishing exception from the response . * @ param response */ private PublishingException readPublishingException ( HttpResponse response ) { } }
InputStream is = null ; PublishingException exception ; try { is = response . getEntity ( ) . getContent ( ) ; GatewayApiErrorBean error = mapper . reader ( GatewayApiErrorBean . class ) . readValue ( is ) ; exception = new PublishingException ( error . getMessage ( ) ) ; StackTraceElement [ ] stack = parseStackTrace (...
public class LocaleData { /** * Returns the set of exemplar characters for a locale . * @ param options Bitmask for options to apply to the exemplar pattern . * Specify zero to retrieve the exemplar set as it is * defined in the locale data . Specify * UnicodeSet . CASE to retrieve a case - folded exemplar * ...
String [ ] exemplarSetTypes = { "ExemplarCharacters" , "AuxExemplarCharacters" , "ExemplarCharactersIndex" , "ExemplarCharactersCurrency" , "ExemplarCharactersPunctuation" } ; if ( extype == ES_CURRENCY ) { // currency symbol exemplar is no longer available return noSubstitute ? null : UnicodeSet . EMPTY ; } try { fina...
public class ZipShort { /** * Get value as two bytes in big endian byte order . * @ return the value as a a two byte array in big endian byte order * @ since 1.1 */ public byte [ ] getBytes ( ) { } }
byte [ ] result = new byte [ 2 ] ; result [ 0 ] = ( byte ) ( value & BYTE_MASK ) ; result [ 1 ] = ( byte ) ( ( value & BYTE_1_MASK ) >> BYTE_1_SHIFT ) ; return result ;
public class DatabaseException { /** * Wrap an exception with a DatabaseException , taking into account all known * subtypes such that we wrap subtypes in a matching type ( so we don ' t obscure * the type available to catch clauses ) . * @ param message the new wrapping exception will have this message * @ par...
if ( cause instanceof ConstraintViolationException ) { return new ConstraintViolationException ( message , cause ) ; } return new DatabaseException ( message , cause ) ;
public class GrailsDomainBinder { /** * Interrogates the specified constraints looking for any constraints that would limit the * precision and / or scale of the property ' s value . If such constraints exist , this method adjusts * the precision and / or scale of the column accordingly . * @ param column the col...
int scale = Column . DEFAULT_SCALE ; int precision = Column . DEFAULT_PRECISION ; PropertyConfig constrainedProperty = ( PropertyConfig ) property . getMapping ( ) . getMappedForm ( ) ; if ( cc != null && cc . getScale ( ) > - 1 ) { column . setScale ( cc . getScale ( ) ) ; } else if ( constrainedProperty . getScale ( ...
public class ScriptContext { /** * Loads the properties file for the test . This file may reference further configuration files , * which are searched relatively to the configuration directory . These extra files must have * keys starting with { @ code system . properties . } . * @ param fileName * the name of ...
config . load ( fileName , preserveExistingProps ) ; String scriptDir = getScriptDir ( ) ; if ( scriptDir != null ) { config . put ( JFunkConstants . SCRIPT_DIR , scriptDir ) ; config . put ( JFunkConstants . SCRIPT_NAME , script . getName ( ) ) ; } config . put ( JFunkConstants . THREAD_ID , Thread . currentThread ( )...
public class AbstractConnectionManager { /** * { @ inheritDoc } */ public void prepareShutdown ( int seconds , GracefulCallback cb ) { } }
shutdown . set ( true ) ; if ( gracefulCallback == null ) gracefulCallback = cb ; if ( pool != null ) pool . flush ( FlushMode . GRACEFULLY ) ; if ( seconds > 0 && scheduledGraceful == null ) { if ( scheduledExecutorService == null ) scheduledExecutorService = Executors . newScheduledThreadPool ( 1 ) ; scheduledGracefu...
public class GetActivityInstanceCmd { /** * Loads all executions that are part of this process instance tree from the dbSqlSession cache . * ( optionally querying the db if a child is not already loaded . * @ param execution the current root execution ( already contained in childExecutions ) * @ param childExecut...
List < ExecutionEntity > childrenOfThisExecution = execution . getExecutions ( ) ; if ( childrenOfThisExecution != null ) { childExecutions . addAll ( childrenOfThisExecution ) ; for ( ExecutionEntity child : childrenOfThisExecution ) { loadChildExecutionsFromCache ( child , childExecutions ) ; } }
public class Util { /** * Attempts to exhaust { @ code source } , returning true if successful . This is useful when reading a * complete source is helpful , such as when doing so completes a cache body or frees a socket * connection for reuse . */ public static boolean discard ( Source source , int timeout , TimeU...
try { return skipAll ( source , timeout , timeUnit ) ; } catch ( IOException e ) { return false ; }
public class MorfologikPolishSpellerRule { /** * Remove suggestions - - not really runon words using a list of non - word suffixes * @ return A list of pruned suggestions . */ private List < String > pruneSuggestions ( final List < String > suggestions ) { } }
List < String > prunedSuggestions = new ArrayList < > ( suggestions . size ( ) ) ; for ( final String suggestion : suggestions ) { if ( suggestion . indexOf ( ' ' ) == - 1 ) { prunedSuggestions . add ( suggestion ) ; } else { String [ ] complexSug = suggestion . split ( " " ) ; if ( ! bannedSuffixes . contains ( comple...
public class StunAttributeFactory { /** * Creates an ErrorCodeAttribute with the specified error class , number and * reason phrase . * @ param errorClass * a valid error class . * @ param errorNumber * a valid error number . * @ param reasonPhrase * a human readable reason phrase . A null reason phrase w...
ErrorCodeAttribute attribute = new ErrorCodeAttribute ( ) ; attribute . setErrorClass ( errorClass ) ; attribute . setErrorNumber ( errorNumber ) ; attribute . setReasonPhrase ( reasonPhrase == null ? ErrorCodeAttribute . getDefaultReasonPhrase ( attribute . getErrorCode ( ) ) : reasonPhrase ) ; return attribute ;
public class MapTileTransitionModel { /** * Get the new transition type from two transitions on horizontal and vertical axis . * @ param a The inner transition . * @ param b The outer transition . * @ param ox The horizontal offset to update . * @ param oy The vertical offset to update . * @ return The new tr...
final TransitionType type ; if ( ox == - 1 && oy == 0 ) { type = TransitionType . from ( ! b . getDownRight ( ) , a . getDownLeft ( ) , ! b . getUpRight ( ) , a . getUpLeft ( ) ) ; } else if ( ox == 1 && oy == 0 ) { type = TransitionType . from ( a . getDownRight ( ) , ! b . getDownLeft ( ) , a . getUpRight ( ) , ! b ....
public class ApplicationSettingsResourceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ApplicationSettingsResource applicationSettingsResource , ProtocolMarshaller protocolMarshaller ) { } }
if ( applicationSettingsResource == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( applicationSettingsResource . getApplicationId ( ) , APPLICATIONID_BINDING ) ; protocolMarshaller . marshall ( applicationSettingsResource . getCampaignHook ...
public class ByteArray { /** * Translate the each ByteArray in an iterable into a hexadecimal string * @ param arrays The array of bytes to translate * @ return An iterable of converted strings */ public static Iterable < String > toHexStrings ( Iterable < ByteArray > arrays ) { } }
ArrayList < String > ret = new ArrayList < String > ( ) ; for ( ByteArray array : arrays ) ret . add ( ByteUtils . toHexString ( array . get ( ) ) ) ; return ret ;
public class ESGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . ESG__REG_NAME : setREGName ( ( String ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class CmsJspNavElement { /** * Returns the value of the property PROPERTY _ NAVTEXT of this navigation element , * or a warning message if this property is not set * ( this method will never return < code > null < / code > ) . < p > * @ return the value of the property PROPERTY _ NAVTEXT of this navigation...
if ( m_text == null ) { // use " lazy initializing " m_text = getProperties ( ) . get ( CmsPropertyDefinition . PROPERTY_NAVTEXT ) ; if ( m_text == null ) { m_text = CmsMessages . formatUnknownKey ( CmsPropertyDefinition . PROPERTY_NAVTEXT ) ; } } return m_text ;
public class MavenArtifactUrlReference { /** * { @ inheritDoc } */ public MavenArtifactUrlReference version ( final VersionResolver resolver ) { } }
validateNotNull ( resolver , "Version resolver" ) ; return version ( resolver . getVersion ( m_groupId , m_artifactId ) ) ;
public class SubnetsInner { /** * Gets the specified subnet by virtual network and resource group . * @ param resourceGroupName The name of the resource group . * @ param virtualNetworkName The name of the virtual network . * @ param subnetName The name of the subnet . * @ param expand Expands referenced resour...
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , virtualNetworkName , subnetName , expand ) , serviceCallback ) ;
public class PiwikRequest { /** * Add a custom tracking parameter to the specified key . This allows users * to have multiple parameters with the same name and different values , * commonly used during situations where list parameters are needed * @ param key the parameter ' s key . Cannot be null * @ param val...
if ( key == null ) { throw new NullPointerException ( "Key cannot be null." ) ; } if ( value == null ) { throw new NullPointerException ( "Cannot add a null custom tracking parameter." ) ; } else { List l = customTrackingParameters . get ( key ) ; if ( l == null ) { l = new ArrayList ( ) ; customTrackingParameters . pu...
public class GridSearch { /** * Start a new grid search job . < p > This method launches any grid search traversing space of hyper * parameters based on specified strategy . * @ param destKey A key to store result of grid search under . * @ param hyperSpaceWalker defines a strategy for traversing a hyper space . ...
// Compute key for destination object representing grid MP params = hyperSpaceWalker . getParams ( ) ; Key < Grid > gridKey = destKey != null ? destKey : gridKeyName ( params . algoName ( ) , params . train ( ) ) ; // Start the search return new GridSearch < > ( gridKey , hyperSpaceWalker ) . start ( ) ;
public class SslListener { /** * Allow the Listener a chance to customise the request . before the server does its stuff . < br > * This allows the required attributes to be set for SSL requests . < br > * The requirements of the Servlet specs are : * < ul > * < li > an attribute named " javax . servlet . reque...
super . customizeRequest ( socket , request ) ; if ( ! ( socket instanceof javax . net . ssl . SSLSocket ) ) return ; // I ' m tempted to let it throw an // exception . . . try { SSLSocket sslSocket = ( SSLSocket ) socket ; SSLSession sslSession = sslSocket . getSession ( ) ; String cipherSuite = sslSession . getCipher...
public class TheMovieDbApi { /** * Get all of the images for a particular collection by collection id . * @ param collectionId collectionId * @ param language language * @ return ResultList * @ throws MovieDbException exception */ public ResultList < Artwork > getCollectionImages ( int collectionId , String lan...
return tmdbCollections . getCollectionImages ( collectionId , language ) ;
public class ClientSocketStats { /** * Record the checkout wait time in us * @ param dest Destination of the socket to checkout . Will actually record * if null . Otherwise will call this on self and corresponding child * with this param null . * @ param checkoutTimeUs The number of us to wait before getting a ...
if ( dest != null ) { getOrCreateNodeStats ( dest ) . recordCheckoutTimeUs ( null , checkoutTimeUs ) ; recordCheckoutTimeUs ( null , checkoutTimeUs ) ; } else { this . checkoutTimeRequestCounter . addRequest ( checkoutTimeUs * Time . NS_PER_US ) ; }
public class Query { /** * < code > * Add a range refinement . Takes a refinement name , a lower and upper bounds . * < / code > * @ param navigationName * The name of the refinement * @ param low * The low value * @ param high * The high value */ public Query addRangeRefinement ( String navigationName ...
return addRangeRefinement ( navigationName , low , high , false ) ;
public class TranslatorTypes { /** * throws NumberFormatException */ private static int getMainNumber ( int mainNumber , String dptID ) { } }
return mainNumber != 0 ? mainNumber : Integer . parseInt ( dptID . substring ( 0 , dptID . indexOf ( '.' ) ) ) ;
public class CollectionUtilsExtended { /** * Does a " group by " or map aggregation on a collection based on keys that are emitted by the given function . For * each key emitted by the function , the map will contain a list at that key entry containing at least one element * from the collection . * @ param collec...
Map < K , List < V > > map = new HashMap < > ( ) ; for ( V value : collection ) { K key = keyFn . apply ( value ) ; if ( map . get ( key ) == null ) { map . put ( key , new ArrayList < V > ( ) ) ; } map . get ( key ) . add ( value ) ; } return map ;
public class LessCompilationEngineFactory { /** * Create a new engine of the specified type if available , or a default engine . * @ param type The engine type . " rhino " , " nashorn " and " commandline " are supported out of the box . * @ param executable The executable in case of commandline engine * @ return ...
if ( type == null || RHINO . equals ( type ) ) { return create ( ) ; } if ( COMMAND_LINE . equals ( type ) ) { return new CommandLineLesscCompilationEngine ( executable ) ; } return new ScriptEngineLessCompilationEngine ( type ) ;
public class PullToRefreshView { /** * This method sets padding for the refresh ( progress ) view . */ public void setRefreshViewPadding ( int left , int top , int right , int bottom ) { } }
mRefreshView . setPadding ( left , top , right , bottom ) ;
public class ListDiscoveredResourcesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListDiscoveredResourcesRequest listDiscoveredResourcesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listDiscoveredResourcesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listDiscoveredResourcesRequest . getResourceType ( ) , RESOURCETYPE_BINDING ) ; protocolMarshaller . marshall ( listDiscoveredResourcesRequest . getResour...
public class KeyVaultClientBaseImpl { /** * Restores a backed up certificate to a vault . * Restores a backed up certificate , and all its versions , to a vault . This operation requires the certificates / restore permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure ....
return restoreCertificateWithServiceResponseAsync ( vaultBaseUrl , certificateBundleBackup ) . toBlocking ( ) . single ( ) . body ( ) ;
public class JsonHelper { /** * Formats the specified timestamp as an ISO 8601 string with milliseconds and UTC timezone . */ public static String formatTimestamp ( @ Nullable Date date ) { } }
return ( date != null ) ? date . toInstant ( ) . toString ( ) : null ;
public class UUID { /** * 返回指定长度随机数字组成的字符串 * @ param length 指定长度 * @ return 随机字符串 */ public static String captchaNumber ( int length ) { } }
StringBuilder sb = new StringBuilder ( ) ; Random rand = new Random ( ) ; for ( int i = 0 ; i < length ; i ++ ) { sb . append ( rand . nextInt ( 10 ) ) ; } return sb . toString ( ) ;
public class CmsSearchTab { /** * Removes the given parameter type . < p > * @ param type the parameter type */ public void removeParameter ( ParamType type ) { } }
switch ( type ) { case language : m_localeSelection . reset ( ) ; break ; case text : m_searchInput . setFormValueAsString ( "" ) ; break ; case expired : m_includeExpiredCheckBox . setChecked ( false ) ; break ; case creation : m_dateCreatedStartDateBox . setValue ( null , true ) ; m_dateCreatedEndDateBox . setValue (...
public class LUDecomposition { /** * Return pivot permutation vector * @ return piv */ public int [ ] getPivot ( ) { } }
int [ ] p = new int [ m ] ; for ( int i = 0 ; i < m ; i ++ ) { p [ i ] = piv [ i ] ; } return p ;
public class BigQuerySnippets { /** * [ VARIABLE " my _ table _ name " ] */ public Table getTable ( String datasetName , String tableName ) { } }
// [ START ] Table table = bigquery . getTable ( datasetName , tableName ) ; // [ END ] return table ;
public class CmsVfsCache { /** * Removes a bunch of cached resources from the cache . < p > * @ param resources a list of resources * @ see # uncacheResource ( CmsResource ) */ protected void uncacheResources ( List < CmsResource > resources ) { } }
if ( resources == null ) { return ; } for ( int i = 0 , n = resources . size ( ) ; i < n ; i ++ ) { // remove the resource uncacheResource ( resources . get ( i ) ) ; }
public class CrossDriver { @ Override public void setup ( TaskContext < CrossFunction < T1 , T2 , OT > , OT > context ) { } }
this . taskContext = context ; this . running = true ;
public class PlayEngine { /** * Schedule a stop to be run from a separate thread to allow the background thread to stop cleanly . */ private void runDeferredStop ( ) { } }
// Stop current jobs from running . clearWaitJobs ( ) ; // Schedule deferred stop executor . log . trace ( "Ran deferred stop" ) ; if ( deferredStop == null ) { // set deferred stop if we get a job name returned deferredStop = subscriberStream . scheduleWithFixedDelay ( new DeferredStopRunnable ( ) , 100 ) ; }
public class CmsObjectWrapper { /** * Moves a resource to the given destination . < p > * Iterates through all configured resource wrappers till the first returns < code > true < / code > . < p > * @ see I _ CmsResourceWrapper # moveResource ( CmsObject , String , String ) * @ see CmsObject # moveResource ( Strin...
boolean exec = false ; // iterate through all wrappers and call " moveResource " till one does not return false List < I_CmsResourceWrapper > wrappers = getWrappers ( ) ; Iterator < I_CmsResourceWrapper > iter = wrappers . iterator ( ) ; while ( iter . hasNext ( ) ) { I_CmsResourceWrapper wrapper = iter . next ( ) ; ex...
public class DependenciesDeployer { /** * Copy jars specified as BootClasspathLibraryOption in system * to the karaf lib path to make them available in the boot classpath * @ throws IOException if copy fails */ public void copyBootClasspathLibraries ( ) throws IOException { } }
BootClasspathLibraryOption [ ] bootClasspathLibraryOptions = subsystem . getOptions ( BootClasspathLibraryOption . class ) ; for ( BootClasspathLibraryOption bootClasspathLibraryOption : bootClasspathLibraryOptions ) { UrlReference libraryUrl = bootClasspathLibraryOption . getLibraryUrl ( ) ; FileUtils . copyURLToFile ...
public class LongTermRetentionBackupsInner { /** * Deletes a long term retention backup . * @ param locationName The location of the database * @ param longTermRetentionServerName the String value * @ param longTermRetentionDatabaseName the String value * @ param backupName The backup name . * @ throws Illega...
deleteWithServiceResponseAsync ( locationName , longTermRetentionServerName , longTermRetentionDatabaseName , backupName ) . toBlocking ( ) . last ( ) . body ( ) ;
public class LogNormalDistributionTypeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case BpsimPackage . LOG_NORMAL_DISTRIBUTION_TYPE__MEAN : unsetMean ( ) ; return ; case BpsimPackage . LOG_NORMAL_DISTRIBUTION_TYPE__STANDARD_DEVIATION : unsetStandardDeviation ( ) ; return ; } super . eUnset ( featureID ) ;
public class CommandFaceDescriptor { /** * Sets the main default large icon for the command . * @ param icon The large icon . May be null . */ public void setLargeIcon ( Icon icon ) { } }
Icon old = null ; if ( largeIconInfo == CommandButtonIconInfo . BLANK_ICON_INFO ) { if ( icon != null ) { // new IconInfo fires event setLargeIconInfo ( new CommandButtonIconInfo ( icon ) ) ; } } else { old = largeIconInfo . getIcon ( ) ; this . largeIconInfo . setIcon ( icon ) ; } firePropertyChange ( LARGE_ICON_PROPE...
public class ListAppsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListAppsRequest listAppsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listAppsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listAppsRequest . getAppIds ( ) , APPIDS_BINDING ) ; protocolMarshaller . marshall ( listAppsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . mars...
public class K3poRule { /** * Blocking call to await for the K3po threads to stop executing . If the connects have not already been initiated via the * start ( ) method , they will be implicitly called . * @ throws Exception if an error has occurred in the execution of the tests . */ public void finish ( ) throws E...
assertTrue ( format ( "Did you call finish() from outside @%s test?" , Specification . class . getSimpleName ( ) ) , ! latch . isInInitState ( ) ) ; // wait for script to finish latch . notifyStartable ( ) ; latch . awaitFinished ( ) ;
public class AttributeService { /** * Returns attributes of the given file as an object of the given type . * @ throws UnsupportedOperationException if the given attributes type is not supported */ @ SuppressWarnings ( "unchecked" ) public < A extends BasicFileAttributes > A readAttributes ( File file , Class < A > t...
AttributeProvider provider = providersByAttributesType . get ( type ) ; if ( provider != null ) { return ( A ) provider . readAttributes ( file ) ; } throw new UnsupportedOperationException ( "unsupported attributes type: " + type ) ;
public class CIType { /** * Get the type this Configuration item represents . * @ return Type */ public org . efaps . admin . datamodel . Type getType ( ) { } }
org . efaps . admin . datamodel . Type ret = null ; try { ret = org . efaps . admin . datamodel . Type . get ( this . uuid ) ; } catch ( final CacheReloadException e ) { CIType . LOG . error ( "Error on retrieving Type for CIType with uuid: {}" , this . uuid ) ; } return ret ;
public class Builder { /** * Declares the interpreter to be used when invoking the RPM * pre - installation script that can be set with the * { @ link # setPreInstallScript ( String ) } method . * @ param program Path to the interpretter */ public void setPreInstallProgram ( final String program ) { } }
if ( null == program ) { format . getHeader ( ) . createEntry ( PREINPROG , DEFAULTSCRIPTPROG ) ; } else if ( 0 == program . length ( ) ) { format . getHeader ( ) . createEntry ( PREINPROG , DEFAULTSCRIPTPROG ) ; } else { format . getHeader ( ) . createEntry ( PREINPROG , program ) ; }
public class ModelSerializer { /** * Load a computation graph from a file * @ param path path to the model file , to get the computation graph from * @ return the loaded computation graph * @ throws IOException */ public static ComputationGraph restoreComputationGraph ( @ NonNull String path , boolean loadUpdater...
return restoreComputationGraph ( new File ( path ) , loadUpdater ) ;
public class SubWriterHolderWriter { /** * Get the summary table . * @ param mw the writer for the member being documented * @ param cd the classdoc to be documented * @ param tableContents list of summary table contents * @ param showTabs true if the table needs to show tabs * @ return the content tree for t...
Content caption ; if ( showTabs ) { caption = getTableCaption ( mw . methodTypes ) ; generateMethodTypesScript ( mw . typeMap , mw . methodTypes ) ; } else { caption = getTableCaption ( mw . getCaption ( ) ) ; } Content table = HtmlTree . TABLE ( HtmlStyle . memberSummary , 0 , 3 , 0 , mw . getTableSummary ( ) , captio...
public class CredHubInfoTemplate { /** * Retrieve the version information from the CredHub server . * @ return the server version information */ @ Override public VersionInfo version ( ) { } }
return credHubOperations . doWithRest ( restOperations -> { ResponseEntity < VersionInfo > response = restOperations . getForEntity ( VERSION_URL_PATH , VersionInfo . class ) ; ExceptionUtils . throwExceptionOnError ( response ) ; return response . getBody ( ) ; } ) ;
public class DomainData { /** * Get the data * @ return The data */ public MBeanData [ ] getData ( ) { } }
MBeanData [ ] data = new MBeanData [ domainData . size ( ) ] ; domainData . toArray ( data ) ; return data ;
public class ScanUploader { /** * Sometimes due to unexpected errors while submitting scan ranges to the underlying queues a scan can get stuck . * This method takes all available tasks for a scan and resubmits them . This method is safe because * the underlying system is resilient to task resubmissions and concurr...
ScanStatus status = _scanStatusDAO . getScanStatus ( scanId ) ; if ( status == null ) { return null ; } if ( status . getCompleteTime ( ) == null ) { // Resubmit any active tasks for ( ScanRangeStatus active : status . getActiveScanRanges ( ) ) { _scanWorkflow . addScanRangeTask ( scanId , active . getTaskId ( ) , acti...
public class AbstractApi { /** * Convenience method for adding query and form parameters to a get ( ) or post ( ) call . * If required is true and value is null , will throw an IllegalArgumentException . * @ param formData the Form containing the name / value pairs * @ param name the name of the field / attribute...
if ( value == null ) { if ( required ) { throw new IllegalArgumentException ( name + " cannot be empty or null" ) ; } return ; } String stringValue = value . toString ( ) ; if ( required && stringValue . trim ( ) . length ( ) == 0 ) { throw new IllegalArgumentException ( name + " cannot be empty or null" ) ; } formData...
public class CliFrontend { /** * Builds command line options for the run action . * @ return Command line options for the run action . */ static Options getRunOptions ( Options options ) { } }
Options o = getProgramSpecificOptions ( options ) ; return getJobManagerAddressOption ( o ) ;
public class JobCat { /** * Remove a global logger . * @ param logger Your desired logger . * @ see # addLogger ( JobLogger ) */ public static synchronized void removeLogger ( @ NonNull JobLogger logger ) { } }
for ( int i = 0 ; i < loggers . length ; i ++ ) { if ( logger . equals ( loggers [ i ] ) ) { loggers [ i ] = null ; // continue , maybe for some reason the logger is twice in the array } }
public class NullLevelFilterFactory { /** * Creates a { @ link Filter } that will always defer to the next Filter in the chain , if any . * @ param threshold the parameter is ignored * @ return a { @ link Filter } with a { @ link Filter # decide ( Object ) } method that will always return { @ link FilterReply # NEU...
return new Filter < E > ( ) { @ Override public FilterReply decide ( E event ) { return FilterReply . NEUTRAL ; } } ;
public class JapaneseCalendar { /** * / * [ deutsch ] * < p > Erzeugt einen modernen japanischen Kalender f & uuml ; r jedes Datum seit Meiji 6 * ( gregorianische Kalenderregeln ) . < / p > * < p > Die gregorianische Bedingung au & szlig ; er Acht lassend , & auml ; quivalent zu * { @ code JapaneseCalendar . of...
if ( ! nengo . isModern ( ) || ( ( nengo == Nengo . MEIJI ) && ( yearOfNengo < 6 ) ) ) { throw new IllegalArgumentException ( "Cannot create modern calendar with lunisolar calendar year." ) ; } return JapaneseCalendar . of ( nengo , yearOfNengo , EastAsianMonth . valueOf ( month ) , dayOfMonth , Leniency . SMART ) ;
public class DeviceDataMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeviceData deviceData , ProtocolMarshaller protocolMarshaller ) { } }
if ( deviceData == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deviceData . getDeviceArn ( ) , DEVICEARN_BINDING ) ; protocolMarshaller . marshall ( deviceData . getDeviceSerialNumber ( ) , DEVICESERIALNUMBER_BINDING ) ; protocolMarshall...
public class MtasSolrCollectionCache { /** * Encode . * @ param o the o * @ return the string * @ throws IOException Signals that an I / O exception has occurred . */ private String encode ( MtasSolrCollectionCacheItem o ) throws IOException { } }
if ( o != null ) { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; ObjectOutputStream objectOutputStream ; objectOutputStream = new ObjectOutputStream ( byteArrayOutputStream ) ; objectOutputStream . writeObject ( o ) ; objectOutputStream . close ( ) ; byte [ ] byteArray = byteArrayOutputS...
public class OrcReader { /** * Does the file start with the ORC magic bytes ? */ private static boolean isValidHeaderMagic ( OrcDataSource source ) throws IOException { } }
byte [ ] headerMagic = new byte [ MAGIC . length ( ) ] ; source . readFully ( 0 , headerMagic ) ; return MAGIC . equals ( Slices . wrappedBuffer ( headerMagic ) ) ;
public class CodedInput { /** * Resets the buffer position and limit to re - use this CodedInput object . */ public void reset ( ) { } }
this . bufferSize = 0 ; this . bufferPos = 0 ; this . bufferSizeAfterLimit = 0 ; this . currentLimit = Integer . MAX_VALUE ; this . lastTag = 0 ; this . packedLimit = 0 ; this . sizeLimit = DEFAULT_SIZE_LIMIT ; resetSizeCounter ( ) ;
public class QueryParser { /** * pseudo selector : contains ( text ) , containsOwn ( text ) */ private void contains ( boolean own ) { } }
tq . consume ( own ? ":containsOwn" : ":contains" ) ; String searchText = TokenQueue . unescape ( tq . chompBalanced ( '(' , ')' ) ) ; Validate . notEmpty ( searchText , ":contains(text) query must not be empty" ) ; if ( own ) evals . add ( new Evaluator . ContainsOwnText ( searchText ) ) ; else evals . add ( new Evalu...
public class GenericHibernateDao { /** * Gets the unique result , that matches a variable number of passed * criterions . * @ param criterion A variable number of hibernate criterions * @ return Entity matching the passed hibernate criterions * @ throws HibernateException if there is more than one matching resu...
LOG . trace ( "Finding one unique " + entityClass . getSimpleName ( ) + " based on " + criterion . length + " criteria" ) ; Criteria criteria = createDistinctRootEntityCriteria ( criterion ) ; return ( E ) criteria . uniqueResult ( ) ;
public class MailMessageConverter { /** * Reads basic message information such as sender , recipients and mail subject to message headers . * @ param msg * @ return */ protected Map < String , Object > createMessageHeaders ( MimeMailMessage msg ) throws MessagingException , IOException { } }
Map < String , Object > headers = new HashMap < > ( ) ; headers . put ( CitrusMailMessageHeaders . MAIL_MESSAGE_ID , msg . getMimeMessage ( ) . getMessageID ( ) ) ; headers . put ( CitrusMailMessageHeaders . MAIL_FROM , StringUtils . arrayToCommaDelimitedString ( msg . getMimeMessage ( ) . getFrom ( ) ) ) ; headers . p...
public class PortalConversionService { /** * / * ( non - Javadoc ) * Modify this method to add more converters . */ @ Override protected void addDefaultConverters ( ) { } }
super . addDefaultConverters ( ) ; /* Add the " shortDate " conversion . */ StringToDate dateAndTimeToDate = new StringToDate ( ) ; dateAndTimeToDate . setPattern ( DATE_AND_TIME_FORMAT ) ; addConverter ( "date" , dateAndTimeToDate ) ;
public class Expressions { /** * Creates an IsBetween expression from the given expressions . * @ param date The date to compare . * @ param lowDate The low date to compare to . * @ param highDate The high date to compare to * @ return A DateIsBetween expression . */ public static DateIsBetween isBetween ( Comp...
return new DateIsBetween ( date , lowDate , highDate ) ;
public class GroupHandlerImpl { /** * Notifying listeners after group deletion . * @ param group * the group which is used in delete operation * @ throws Exception * if any listener failed to handle the event */ private void postDelete ( Group group ) throws Exception { } }
for ( GroupEventListener listener : listeners ) { listener . postDelete ( group ) ; }
public class TypedObject { /** * Factory method * @ param < IDTYPE > * The type of the ID . * @ param aObjectType * Object type to use . May not be < code > null < / code > . * @ param aID * ID to be used . May not be < code > null < / code > . * @ return new { @ link TypedObject } */ @ Nonnull public sta...
return new TypedObject < > ( aObjectType , aID ) ;
public class ReadFileExtensions { /** * Reads every line from the given InputStream and puts them to the List . * @ param input * The InputStream from where the input comes . * @ param trim * the flag trim if the lines shell be trimed . * @ return The List with all lines from the file . * @ throws IOExcepti...
// return the list with all lines from the file . return readLinesInList ( input , Charset . forName ( "UTF-8" ) , trim ) ;
public class GraphitePickleWriter { /** * Send given metrics to the Graphite server . */ @ Override public void write ( Iterable < QueryResult > results ) { } }
logger . debug ( "Export to '{}' results {}" , graphiteServerHostAndPort , results ) ; SocketOutputStream socketOutputStream = null ; try { socketOutputStream = socketOutputStreamPool . borrowObject ( graphiteServerHostAndPort ) ; PyList list = new PyList ( ) ; for ( QueryResult result : results ) { String metricName =...
public class BitmapUtil { /** * Creates and returns a bitmap from a specific text . The text is centered . * @ param context * The context , which should be used , as an instance of the class { @ link Context } . The * context may not be null * @ param width * The width of the bitmap , which should be created...
Condition . INSTANCE . ensureNotNull ( context , "The context may not be null" ) ; Condition . INSTANCE . ensureNotNull ( text , "The text may not be null" ) ; Condition . INSTANCE . ensureNotEmpty ( text , "The text may not be empty" ) ; Condition . INSTANCE . ensureAtLeast ( textSize , 1 , "The text size must be at l...
public class JsExprUtils { /** * Builds one JS expression that computes the concatenation of the given JS expressions . The ' + ' * operator is used for concatenation . Operands will be protected with an extra pair of * parentheses if and only if needed . * < p > The resulting expression is not guaranteed to be a...
if ( jsExprs . isEmpty ( ) ) { return EMPTY_STRING ; } if ( jsExprs . size ( ) == 1 ) { return jsExprs . get ( 0 ) ; } int plusOpPrec = Operator . PLUS . getPrecedence ( ) ; StringBuilder resultSb = new StringBuilder ( ) ; boolean isFirst = true ; for ( JsExpr jsExpr : jsExprs ) { // The first operand needs protection ...
public class BlockDataHandler { /** * Gets the { @ link ChunkData } for the specified identifier and { @ link BlockPos } * @ param < T > the generic type * @ param identifier the identifier * @ param world the world * @ param pos the pos * @ return the chunk data */ private < T > ChunkData < T > chunkData ( S...
return world != null ? chunkData ( identifier , world , world . getChunkFromBlockCoords ( pos ) ) : null ;
public class DurableLog { /** * region Helpers */ private void ensureRunning ( ) { } }
Exceptions . checkNotClosed ( this . closed . get ( ) , this ) ; if ( state ( ) != State . RUNNING ) { throw new IllegalContainerStateException ( getId ( ) , state ( ) , State . RUNNING ) ; } else if ( isOffline ( ) ) { throw new ContainerOfflineException ( getId ( ) ) ; }
public class Transformation3D { /** * Sets all elements to 0 , thus producing and invalid transformation . */ public void setZero ( ) { } }
xx = 0.0 ; yx = 0.0 ; zx = 0.0 ; xy = 0.0 ; yy = 0.0 ; zy = 0.0 ; xz = 0.0 ; yz = 0.0 ; zz = 0.0 ; xd = 0.0 ; yd = 0.0 ; zd = 0.0 ;
public class CalendarApi { /** * Respond to an event ( asynchronously ) Set your response status to an event * - - - SSO Scope : esi - calendar . respond _ calendar _ events . v1 * @ param characterId * An EVE character ID ( required ) * @ param eventId * The ID of the event requested ( required ) * @ param...
com . squareup . okhttp . Call call = putCharactersCharacterIdCalendarEventIdValidateBeforeCall ( characterId , eventId , datasource , token , characterCalendarEvent , callback ) ; apiClient . executeAsync ( call , callback ) ; return call ;
public class NumberBackgroundColorTableCellRenderer { /** * Creates the function that returns the cell background color for a * given value . If the value is a number , it will be mapped from * the range ( min , max ) to the range ( 0,1 ) , and the given function * will be used to look up the color based on that ...
Objects . requireNonNull ( colorFunction , "The colorFunction may not be null" ) ; DoubleUnaryOperator mapping = value -> ( value - min ) / ( max - min ) ; Function < Object , Color > cellColorFunction = object -> { if ( object instanceof Number ) { Number number = ( Number ) object ; double normalized = mapping . appl...
public class SloppyMath { /** * Returns the minimum of three int values . */ public static int min ( int a , int b , int c ) { } }
int mi ; mi = a ; if ( b < mi ) { mi = b ; } if ( c < mi ) { mi = c ; } return mi ;
public class RestHttpClientImpl { /** * Format the given parameter object into string . */ private String parameterToString ( Object param ) { } }
if ( param == null ) { return "" ; } else if ( param instanceof Date ) { return formatDate ( ( Date ) param ) ; } else if ( param instanceof Collection ) { StringBuilder b = new StringBuilder ( ) ; for ( Object o : ( Collection ) param ) { if ( b . length ( ) > 0 ) { b . append ( "," ) ; } b . append ( String . valueOf...