signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class HttpRequestUtils { /** * Check if a parameter exists . * @ param request the HTTP request * @ param name the parameter name * @ return whether the parameter exists */ public static boolean doesParameterExist ( final HttpServletRequest request , final String name ) { } }
val parameter = request . getParameter ( name ) ; if ( StringUtils . isBlank ( parameter ) ) { LOGGER . error ( "Missing request parameter: [{}]" , name ) ; return false ; } LOGGER . debug ( "Found provided request parameter [{}]" , name ) ; return true ;
public class AbstractGitFlowMojo { /** * Checks if branch name is acceptable . * @ param branchName * Branch name to check . * @ return < code > true < / code > when name is valid , < code > false < / code > * otherwise . * @ throws MojoFailureException * @ throws CommandLineException */ protected boolean validBranchName ( final String branchName ) throws MojoFailureException , CommandLineException { } }
CommandResult r = executeGitCommandExitCode ( "check-ref-format" , "--allow-onelevel" , branchName ) ; return r . getExitCode ( ) == SUCCESS_EXIT_CODE ;
public class Main { /** * TODO : make level an enum */ public void find ( String level , String cp1 , String cp2 ) throws IOException { } }
if ( level == null || cp1 == null ) { throw new IllegalArgumentException ( "level and cp1 are required" ) ; } if ( cp2 == null ) { cp2 = cp1 ; } int levelFlag ; if ( "class" . equals ( level ) ) { levelFlag = DepHandler . LEVEL_CLASS ; } else if ( "jar" . equals ( level ) ) { levelFlag = DepHandler . LEVEL_JAR ; } else { throw new IllegalArgumentException ( "unknown level " + level ) ; } PrintWriter w = new PrintWriter ( System . out ) ; DepHandler handler = new TextDepHandler ( w , levelFlag ) ; new DepFind ( ) . run ( cp1 , cp2 , handler ) ; w . flush ( ) ;
public class AbstractQueryPersonAttributeDao { /** * Configuration convenience same as passing the given { @ code Set } as the * keys in the { @ link # setCaseInsensitiveResultAttributes ( java . util . Map ) } * { @ code Map } and implicitly accepting the default canonicalization mode * for each . Note that this setter will not assign canonicalization modes , * meaning that you needn ' t ensure * { @ link # setDefaultCaseCanonicalizationMode ( CaseCanonicalizationMode ) } * has already been called . * @ param caseInsensitiveResultAttributes Set of result attribute names */ public void setCaseInsensitiveResultAttributesAsCollection ( final Collection < String > caseInsensitiveResultAttributes ) { } }
if ( caseInsensitiveResultAttributes == null || caseInsensitiveResultAttributes . isEmpty ( ) ) { setCaseInsensitiveResultAttributes ( null ) ; } else { final Map < String , CaseCanonicalizationMode > asMap = new HashMap < > ( ) ; for ( final String attrib : caseInsensitiveResultAttributes ) { asMap . put ( attrib , null ) ; } setCaseInsensitiveResultAttributes ( asMap ) ; }
public class BaseBigtableTableAdminClient { /** * Lists all tables served from a specified instance . * < p > Sample code : * < pre > < code > * try ( BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient . create ( ) ) { * InstanceName parent = InstanceName . of ( " [ PROJECT ] " , " [ INSTANCE ] " ) ; * for ( Table element : baseBigtableTableAdminClient . listTables ( parent ) . iterateAll ( ) ) { * / / doThingsWith ( element ) ; * < / code > < / pre > * @ param parent The unique name of the instance for which tables should be listed . Values are of * the form ` projects / & lt ; project & gt ; / instances / & lt ; instance & gt ; ` . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final ListTablesPagedResponse listTables ( InstanceName parent ) { } }
ListTablesRequest request = ListTablesRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . build ( ) ; return listTables ( request ) ;
public class IdpMetadataGenerator { /** * List of bindings to be included in the generated metadata for Web Single Sign - On . Ordering of bindings affects * inclusion in the generated metadata . * Supported values are : " post " ( or * " urn : oasis : names : tc : SAML : 2.0 : bindings : HTTP - POST " ) . * The following bindings are included by default : " post " * @ param bindingsSSO * bindings for web single sign - on */ public void setBindingsSSO ( Collection < String > bindingsSSO ) { } }
if ( bindingsSSO == null ) { this . bindingsSSO = Collections . emptyList ( ) ; } else { this . bindingsSSO = bindingsSSO ; }
public class SoftCache { /** * Looks up and returns the value associated with the supplied key . */ public V get ( K key ) { } }
V value = null ; SoftReference < V > ref = _map . get ( key ) ; if ( ref != null ) { value = ref . get ( ) ; if ( value == null ) { _map . remove ( key ) ; } } return value ;
public class KinesisDataFetcher { /** * Updates the last discovered shard of a subscribed stream ; only updates if the update is valid . */ public void advanceLastDiscoveredShardOfStream ( String stream , String shardId ) { } }
String lastSeenShardIdOfStream = this . subscribedStreamsToLastDiscoveredShardIds . get ( stream ) ; // the update is valid only if the given shard id is greater // than the previous last seen shard id of the stream if ( lastSeenShardIdOfStream == null ) { // if not previously set , simply put as the last seen shard id this . subscribedStreamsToLastDiscoveredShardIds . put ( stream , shardId ) ; } else if ( shouldAdvanceLastDiscoveredShardId ( shardId , lastSeenShardIdOfStream ) ) { this . subscribedStreamsToLastDiscoveredShardIds . put ( stream , shardId ) ; }
public class Filters { /** * Specify one or more < a > KeyUsage < / a > extension values . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setKeyUsage ( java . util . Collection ) } or { @ link # withKeyUsage ( java . util . Collection ) } if you want to override * the existing values . * @ param keyUsage * Specify one or more < a > KeyUsage < / a > extension values . * @ return Returns a reference to this object so that method calls can be chained together . * @ see KeyUsageName */ public Filters withKeyUsage ( String ... keyUsage ) { } }
if ( this . keyUsage == null ) { setKeyUsage ( new java . util . ArrayList < String > ( keyUsage . length ) ) ; } for ( String ele : keyUsage ) { this . keyUsage . add ( ele ) ; } return this ;
public class AccessControlClient { /** * Return the most specific matching rule for the requested document . * @ param url * URL of the requested document . * @ param captureDate * Date the document was archived . * @ param retrievalDate * Date of retrieval ( usually now ) . * @ param groups * Group names of the user accessing the document . * @ return * @ throws RuleOracleUnavailableException */ @ Deprecated public Rule getRule ( String url , Date captureDate , Date retrievalDate , Collection < String > groups ) throws RuleOracleUnavailableException { } }
Rule bestRule = null ; for ( String who : groups ) { Rule rule = getRule ( url , captureDate , retrievalDate , who ) ; /* We compare policies not the rules themselves as * a user should have full access to something one of their * groups has access to , even if another group they are * member of does not . */ if ( bestRule == null || rule . getPolicy ( ) . compareTo ( bestRule . getPolicy ( ) ) < 0 ) { bestRule = rule ; } } return bestRule ;
public class DefaultValuePopulator { /** * Populates an entity with default values * @ param entity populated entity */ public void populate ( Entity entity ) { } }
stream ( entity . getEntityType ( ) . getAllAttributes ( ) ) . filter ( Attribute :: hasDefaultValue ) . forEach ( attr -> populateDefaultValues ( entity , attr ) ) ;
public class TimeZoneFormat { /** * Parses the localized GMT pattern string and initialize * localized gmt pattern fields including { { @ link # _ gmtPatternTokens } . * This method must be also called at deserialization time . * @ param gmtPattern the localized GMT pattern string such as " GMT { 0 } " * @ throws IllegalArgumentException when the pattern string does not contain " { 0 } " */ private void initGMTPattern ( String gmtPattern ) { } }
// This implementation not perfect , but sufficient practically . int idx = gmtPattern . indexOf ( "{0}" ) ; if ( idx < 0 ) { throw new IllegalArgumentException ( "Bad localized GMT pattern: " + gmtPattern ) ; } _gmtPattern = gmtPattern ; _gmtPatternPrefix = unquote ( gmtPattern . substring ( 0 , idx ) ) ; _gmtPatternSuffix = unquote ( gmtPattern . substring ( idx + 3 ) ) ;
public class CassandraDataHandlerBase { /** * Builds the thrift super column . * @ param timestamp2 * the timestamp2 * @ param m * the m * @ param id * the id * @ param superColumn * the super column * @ param superColumnName * the super column name * @ param obj * the obj * @ return the map */ private Map < String , Object > buildThriftSuperColumn ( long timestamp2 , EntityMetadata m , Object id , EmbeddableType superColumn , String superColumnName , Object obj ) { } }
Map < String , Object > thriftSuperColumns = null ; if ( m . isCounterColumnType ( ) ) { thriftSuperColumns = buildThriftCounterSuperColumn ( m . getTableName ( ) , superColumnName , superColumn , obj ) ; } else { thriftSuperColumns = buildThriftSuperColumn ( m . getTableName ( ) , superColumnName , timestamp2 , superColumn , obj ) ; } return thriftSuperColumns ;
public class AbstractWComponent { /** * { @ inheritDoc } */ @ Override public String getBaseUrl ( ) { } }
Environment env = getEnvironment ( ) ; String baseUrl = null ; if ( env != null ) { baseUrl = env . getBaseUrl ( ) ; } return ( baseUrl == null ? "" : baseUrl ) ;
public class LogoController { /** * Get a file from the logo subdirectory of the filestore */ @ GetMapping ( "/logo/{name}.{extension}" ) public void getLogo ( OutputStream out , @ PathVariable ( "name" ) String name , @ PathVariable ( "extension" ) String extension , HttpServletResponse response ) throws IOException { } }
File f = fileStore . getFileUnchecked ( "/logo/" + name + "." + extension ) ; if ( ! f . exists ( ) ) { response . sendError ( HttpServletResponse . SC_NOT_FOUND ) ; return ; } // Try to get contenttype from file String contentType = URLConnection . guessContentTypeFromName ( f . getName ( ) ) ; if ( contentType != null ) { response . setContentType ( contentType ) ; } FileCopyUtils . copy ( new FileInputStream ( f ) , out ) ;
public class Entity { /** * 获得字符串值 < br > * 支持Clob 、 Blob 、 RowId * @ param field 字段名 * @ param charset 编码 * @ return 字段对应值 * @ since 3.0.6 */ public String getStr ( String field , Charset charset ) { } }
final Object obj = get ( field ) ; if ( obj instanceof Clob ) { return SqlUtil . clobToStr ( ( Clob ) obj ) ; } else if ( obj instanceof Blob ) { return SqlUtil . blobToStr ( ( Blob ) obj , charset ) ; } else if ( obj instanceof RowId ) { final RowId rowId = ( RowId ) obj ; return StrUtil . str ( rowId . getBytes ( ) , charset ) ; } return super . getStr ( field ) ;
public class OmdbBuilder { /** * Limit the results to movies * @ return */ public OmdbBuilder setTypeMovie ( ) { } }
if ( ! ResultType . isDefault ( ResultType . MOVIE ) ) { params . add ( Param . RESULT , ResultType . MOVIE ) ; } return this ;
public class PseudoClassSpecifierChecker { /** * Add { @ code : last - child } elements . * @ see < a href = " http : / / www . w3 . org / TR / css3 - selectors / # last - child - pseudo " > < code > : last - child < / code > pseudo - class < / a > */ private void addLastChildElements ( ) { } }
for ( Node node : nodes ) { if ( DOMHelper . getNextSiblingElement ( node ) == null ) { result . add ( node ) ; } }
public class FilterModel { /** * Internal method used to lookup { @ link Filter } instances by < code > filterExpression < / code > . * @ param filterExpression the filter expression whose filters to find * @ return < code > null < / code > if no matching { @ link Filter } objects are found ; a { @ link List } of { @ link Filter } * objects otherwise . */ private ArrayList /* < Filter > */ lookupFilters ( String filterExpression ) { } }
assert filterExpression != null ; assert ! filterExpression . equals ( "" ) ; /* todo : perf . caching or abstraction to make this faster */ ArrayList /* < Filter > */ filters = new ArrayList /* < Filter > */ ( ) ; for ( int i = 0 ; i < _filters . size ( ) ; i ++ ) { assert _filters . get ( i ) instanceof Filter ; Filter filter = ( Filter ) _filters . get ( i ) ; if ( filter . getFilterExpression ( ) . equals ( filterExpression ) ) filters . add ( filter ) ; } return filters . size ( ) > 0 ? filters : null ;
public class SchemaStoreItemStream { /** * Add a new schema defintion to the store */ void addSchema ( JMFSchema schema , Transaction tran ) throws MessageStoreException { } }
addItem ( new SchemaStoreItem ( schema ) , tran ) ;
public class NetworkEntryEvent { /** * Add an Active Participant to this message representing the node doing * the network entry * @ param userId The Active Participant ' s User ID * @ param altUserId The Active Participant ' s Alternate UserID * @ param userName The Active Participant ' s UserName * @ param networkId The Active Participant ' s Network Access Point ID */ public void addNodeActiveParticipant ( String userId , String altUserId , String userName , String networkId ) { } }
addActiveParticipant ( userId , altUserId , userName , false , null , networkId ) ;
public class SharedPreferencesHelper { /** * Retrieve an Integer value from the preferences . * @ param key The name of the preference to retrieve * @ param defaultValue Value to return if this preference does not exist * @ return the preference value if it exists , or defaultValue . */ public Integer loadPreferenceAsInteger ( String key , Integer defaultValue ) { } }
Integer value = defaultValue ; if ( hasPreference ( key ) ) { value = getSharedPreferences ( ) . getInt ( key , 0 ) ; } logLoad ( key , value ) ; return value ;
public class Request { /** * Send this resource request asynchronously , with the given JSON object as the request body . * If no Content - Type header was set , this method will set it to " application / json " . * @ param context The context that will be passed to authentication listener . * @ param json The JSON object to put in the request body * @ param listener The listener whose onSuccess or onFailure methods will be called when this request finishes */ protected void send ( Context context , JSONObject json , ResponseListener listener ) { } }
setContext ( context ) ; super . send ( json , listener ) ;
public class ReportingController { /** * Report on the features of a layer with map image and legend , data coming from the cache . * @ param reportName name of the report * @ param format format for the report ( eg " pdf " ) * @ param layerId id of the layer * @ param key cache key for data * @ param request request object for report parameters * @ param model mvc model * @ return name of the view */ @ RequestMapping ( value = "/reporting/c/{layerId}/{reportName}.{format}" , method = RequestMethod . GET ) public String reportFromCache ( @ PathVariable String reportName , @ PathVariable String format , @ PathVariable String layerId , @ RequestParam ( required = true ) String key , HttpServletRequest request , Model model ) { } }
try { VectorLayer layer = configurationService . getVectorLayer ( layerId ) ; if ( null != layer ) { ReportingCacheContainer container = cacheManager . get ( layer , CacheCategory . RASTER , key , ReportingCacheContainer . class ) ; addParameters ( model , request ) ; if ( null != container ) { model . addAttribute ( "map" , JRImageRenderer . getInstance ( container . getMapImageData ( ) ) ) ; model . addAttribute ( "legend" , JRImageRenderer . getInstance ( container . getLegendImageData ( ) ) ) ; model . addAttribute ( DATA_SOURCE , getDataSource ( container ) ) ; } else { model . addAttribute ( DATA_SOURCE , new InternalFeatureDataSource ( new ArrayList < InternalFeature > ( ) ) ) ; } } } catch ( GeomajasException ge ) { log . error ( REPORT_DATA_PROBLEM , ge ) ; model . addAttribute ( DATA_SOURCE , new InternalFeatureDataSource ( new ArrayList < InternalFeature > ( ) ) ) ; } model . addAttribute ( JasperReportsMultiFormatView . DEFAULT_FORMAT_KEY , format ) ; return getView ( reportName ) ;
public class CRest { /** * < p > Adds given property to the { @ link org . codegist . crest . CRestConfig } that will be passed to all < b > CRest < / b > components . < / p > * @ param name property name * @ param value property value * @ return a CRestBuilder instance * @ see org . codegist . crest . CRestBuilder # property ( String , Object ) */ public static CRestBuilder property ( String name , Object value ) { } }
return new CRestBuilder ( ) . property ( name , value ) ;
public class FIODataPoint { /** * Return the data point field with the corresponding key * @ param key name of the field in the data point * @ return the field value */ public String getByKey ( String key ) { } }
String out = "" ; if ( key . equals ( "time" ) ) return time ( ) ; if ( key . contains ( "Time" ) ) { DateFormat dfm = new SimpleDateFormat ( "HH:mm:ss" ) ; dfm . setTimeZone ( TimeZone . getTimeZone ( timezone ) ) ; out = dfm . format ( Long . parseLong ( String . valueOf ( this . datapoint . get ( key ) ) ) * 1000 ) ; } else out = String . valueOf ( datapoint . get ( key ) ) ; return out ;
public class AWSIoTAnalyticsClient { /** * Retrieves information about a data set . * @ param describeDatasetRequest * @ return Result of the DescribeDataset operation returned by the service . * @ throws InvalidRequestException * The request was not valid . * @ throws ResourceNotFoundException * A resource with the specified name could not be found . * @ throws InternalFailureException * There was an internal failure . * @ throws ServiceUnavailableException * The service is temporarily unavailable . * @ throws ThrottlingException * The request was denied due to request throttling . * @ sample AWSIoTAnalytics . DescribeDataset * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / iotanalytics - 2017-11-27 / DescribeDataset " target = " _ top " > AWS * API Documentation < / a > */ @ Override public DescribeDatasetResult describeDataset ( DescribeDatasetRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeDataset ( request ) ;
public class SubsetVec { /** * Write out K / V pairs */ @ Override protected AutoBuffer writeAll_impl ( AutoBuffer ab ) { } }
ab . putKey ( _subsetRowsKey ) ; return super . writeAll_impl ( ab ) ;
public class DrawerUIUtils { /** * helper to set the vertical padding to the DrawerItems * this is required because on API Level 17 the padding is ignored which is set via the XML * @ param v */ public static void setDrawerVerticalPadding ( View v ) { } }
int verticalPadding = v . getContext ( ) . getResources ( ) . getDimensionPixelSize ( R . dimen . material_drawer_vertical_padding ) ; v . setPadding ( verticalPadding , 0 , verticalPadding , 0 ) ;
public class Filtering { /** * Creates an iterator yielding values from the source array up until the * passed predicate doesn ' t match . E . g : * < code > dropWhile ( [ 2 , 4 , 3 , 6 ] , isOdd ) - > [ 2 , 4 ] < / code > * @ param < E > the array element type * @ param array the source array * @ param predicate the predicate to be evaluated * @ return the resulting iterator */ public static < E > Iterator < E > dropWhile ( E [ ] array , Predicate < E > predicate ) { } }
return new FilteringIterator < E > ( new ArrayIterator < E > ( array ) , new DropWhile < E > ( predicate ) ) ;
public class ManagedExecutorBuilderImpl { /** * Fail with error indentifying the overlap ( s ) in context types between : * cleared , propagated . * @ throws IllegalStateException identifying the overlap . */ private void failOnOverlapOfClearedPropagated ( ) { } }
HashSet < String > overlap = new HashSet < String > ( cleared ) ; overlap . retainAll ( propagated ) ; if ( overlap . isEmpty ( ) ) // only possible if builder is concurrently modified during build throw new ConcurrentModificationException ( ) ; throw new IllegalStateException ( Tr . formatMessage ( tc , "CWWKC1151.context.lists.overlap" , overlap ) ) ;
public class JsGeometryMergeService { /** * Register a { @ link GeometryMergeStopHandler } to listen to events that signal the merging process has ended * ( either through stop or cancel ) . * @ param handler * The { @ link GeometryMergeStopHandler } to add as listener . * @ return The registration of the handler . */ public JsHandlerRegistration addGeometryMergeStopHandler ( final GeometryMergeStopHandler handler ) { } }
org . geomajas . plugin . editing . client . merge . event . GeometryMergeStopHandler h ; h = new org . geomajas . plugin . editing . client . merge . event . GeometryMergeStopHandler ( ) { public void onGeometryMergingStop ( GeometryMergeStopEvent event ) { org . geomajas . plugin . editing . jsapi . client . merge . event . GeometryMergeStopEvent e ; e = new org . geomajas . plugin . editing . jsapi . client . merge . event . GeometryMergeStopEvent ( ) ; handler . onGeometryMergeStop ( e ) ; } } ; HandlerRegistration registration = delegate . addGeometryMergeStopHandler ( h ) ; return new JsHandlerRegistration ( new HandlerRegistration [ ] { registration } ) ;
public class HttpClientResponseImpl { /** * Parses the timeout value from the HTTP keep alive header ( with name { @ link # KEEP _ ALIVE _ HEADER _ NAME } ) as described in * < a href = " http : / / tools . ietf . org / id / draft - thomson - hybi - http - timeout - 01 . html " > this spec < / a > * @ return The keep alive timeout or { @ code null } if this response does not define the appropriate header value . */ public Long getKeepAliveTimeoutSeconds ( ) { } }
String keepAliveHeader = nettyResponse . headers ( ) . get ( KEEP_ALIVE_HEADER_NAME ) ; if ( null != keepAliveHeader && ! keepAliveHeader . isEmpty ( ) ) { String [ ] pairs = PATTERN_COMMA . split ( keepAliveHeader ) ; if ( pairs != null ) { for ( String pair : pairs ) { String [ ] nameValue = PATTERN_EQUALS . split ( pair . trim ( ) ) ; if ( nameValue != null && nameValue . length >= 2 ) { String name = nameValue [ 0 ] . trim ( ) . toLowerCase ( ) ; String value = nameValue [ 1 ] . trim ( ) ; if ( KEEP_ALIVE_TIMEOUT_HEADER_ATTR . equals ( name ) ) { try { return Long . valueOf ( value ) ; } catch ( NumberFormatException e ) { logger . info ( "Invalid HTTP keep alive timeout value. Keep alive header: " + keepAliveHeader + ", timeout attribute value: " + nameValue [ 1 ] , e ) ; return null ; } } } } } } return null ;
public class MapBindTransformation { /** * Generate serialize on jackson internal . * @ param context the context * @ param methodBuilder the method builder * @ param serializerName the serializer name * @ param beanClass the bean class * @ param beanName the bean name * @ param property the property * @ param onString the on string */ void generateSerializeOnJacksonInternal ( BindTypeContext context , MethodSpec . Builder methodBuilder , String serializerName , TypeName beanClass , String beanName , BindProperty property , boolean onString ) { } }
// define key and value type ParameterizedTypeName mapTypeName = ( ParameterizedTypeName ) property . getPropertyType ( ) . getTypeName ( ) ; TypeName keyTypeName = mapTypeName . typeArguments . get ( 0 ) ; TypeName valueTypeName = mapTypeName . typeArguments . get ( 1 ) ; // @ formatter : off methodBuilder . beginControlFlow ( "if ($L!=null) " , getter ( beanName , beanClass , property ) ) ; if ( property . isProperty ( ) ) { methodBuilder . addStatement ( "fieldCount++" ) ; } // fields are in objects , no in collection BindTransform transformKey = BindTransformer . lookup ( keyTypeName ) ; BindProperty elementKeyProperty = BindProperty . builder ( keyTypeName , property ) . nullable ( false ) . xmlType ( property . xmlInfo . mapEntryType . toXmlType ( ) ) . inCollection ( false ) . elementName ( property . mapKeyName ) . build ( ) ; BindTransform transformValue = BindTransformer . lookup ( valueTypeName ) ; BindProperty elementValueProperty = BindProperty . builder ( valueTypeName , property ) . nullable ( false ) . xmlType ( property . xmlInfo . mapEntryType . toXmlType ( ) ) . inCollection ( false ) . elementName ( property . mapValueName ) . build ( ) ; methodBuilder . addCode ( "// write wrapper tag\n" ) ; // BEGIN - if map has elements methodBuilder . beginControlFlow ( "if ($L.size()>0)" , getter ( beanName , beanClass , property ) ) ; methodBuilder . addStatement ( "$L.writeFieldName($S)" , serializerName , property . label ) ; methodBuilder . addStatement ( "$L.writeStartArray()" , serializerName ) ; methodBuilder . beginControlFlow ( "for ($T<$T, $T> item: $L.entrySet())" , Entry . class , keyTypeName , valueTypeName , getter ( beanName , beanClass , property ) ) ; methodBuilder . addStatement ( "$L.writeStartObject()" , serializerName ) ; if ( onString ) { transformKey . generateSerializeOnJacksonAsString ( context , methodBuilder , serializerName , null , "item.getKey()" , elementKeyProperty ) ; } else { transformKey . generateSerializeOnJackson ( context , methodBuilder , serializerName , null , "item.getKey()" , elementKeyProperty ) ; } // field is always nullable methodBuilder . beginControlFlow ( "if (item.getValue()==null)" ) ; // KRITPON - 38 : in a collection , for null object we write " null " string if ( onString ) { methodBuilder . addStatement ( "$L.writeStringField($S, \"null\")" , serializerName , property . mapValueName ) ; } else { methodBuilder . addStatement ( "$L.writeNullField($S)" , serializerName , property . mapValueName ) ; } methodBuilder . nextControlFlow ( "else" ) ; if ( onString ) { transformValue . generateSerializeOnJacksonAsString ( context , methodBuilder , serializerName , null , "item.getValue()" , elementValueProperty ) ; } else { transformValue . generateSerializeOnJackson ( context , methodBuilder , serializerName , null , "item.getValue()" , elementValueProperty ) ; } methodBuilder . endControlFlow ( ) ; methodBuilder . addStatement ( "$L.writeEndObject()" , serializerName ) ; methodBuilder . endControlFlow ( ) ; methodBuilder . addStatement ( "$L.writeEndArray()" , serializerName ) ; // ELSE - if map has elements methodBuilder . nextControlFlow ( "else" ) ; if ( onString ) { methodBuilder . addStatement ( "$L.writeStringField($S, \"null\")" , serializerName , property . label ) ; } else { methodBuilder . addStatement ( "$L.writeNullField($S)" , serializerName , property . label ) ; } // END - if map has elements methodBuilder . endControlFlow ( ) ; methodBuilder . endControlFlow ( ) ; // @ formatter : on
public class InstanceChangeStreamListenerImpl { /** * Returns the latest change events for a given namespace . * @ param namespace the namespace to get events for . * @ return the latest change events for a given namespace . */ public Map < BsonValue , ChangeEvent < BsonDocument > > getEventsForNamespace ( final MongoNamespace namespace ) { } }
this . instanceLock . readLock ( ) . lock ( ) ; final NamespaceChangeStreamListener streamer ; try { streamer = nsStreamers . get ( namespace ) ; } finally { this . instanceLock . readLock ( ) . unlock ( ) ; } if ( streamer == null ) { return new HashMap < > ( ) ; } return streamer . getEvents ( ) ;
public class AzureInstanceActionDaemon { /** * Start the instance */ private void start ( final ResourceInstanceEntity instance ) { } }
azure . start ( instance . getProviderInstanceId ( ) ) ; instance . setState ( ResourceInstanceState . PROVISIONING ) ;
public class SmileConverter { /** * Returns a dataset where the response column is nominal . E . g . to be used for a classification */ public AttributeDataset nominalDataset ( int responseColIndex , int ... variablesColIndices ) { } }
return dataset ( table . numberColumn ( responseColIndex ) , AttributeType . NOMINAL , table . columns ( variablesColIndices ) ) ;
public class MapUtils { /** * Returns a map where the ith element of keys maps to the ith element of * values . * @ param keys * @ param values * @ return */ public static < A , B > Map < A , B > fromLists ( List < A > keys , List < B > values ) { } }
Preconditions . checkArgument ( keys . size ( ) == values . size ( ) ) ; Map < A , B > map = Maps . newHashMap ( ) ; for ( int i = 0 ; i < keys . size ( ) ; i ++ ) { map . put ( keys . get ( i ) , values . get ( i ) ) ; } return map ;
public class ReservoirItemsSketch { /** * Thin wrapper around private constructor * @ param < T > data type * @ param data Reservoir items as ArrayList & lt ; T & gt ; * @ param itemsSeen Number of items presented to the sketch so far * @ param rf < a href = " { @ docRoot } / resources / dictionary . html # resizeFactor " > See Resize Factor < / a > * @ param k Compact encoding of reservoir size * @ return New sketch built with the provided inputs */ static < T > ReservoirItemsSketch < T > newInstance ( final ArrayList < T > data , final long itemsSeen , final ResizeFactor rf , final int k ) { } }
return new ReservoirItemsSketch < > ( data , itemsSeen , rf , k ) ;
public class ExecutionEnvironment { /** * Creates a DataSet from the given iterator . Because the iterator will remain unmodified until * the actual execution happens , the type of data returned by the iterator must be given * explicitly in the form of the type information . This method is useful for cases where the type * is generic . In that case , the type class ( as given in { @ link # fromCollection ( Iterator , Class ) } * does not supply all type information . * The iterator must be serializable ( as defined in { @ link java . io . Serializable } ) , because the * framework may move it to a remote environment , if needed . * Note that this operation will result in a non - parallel data source , i . e . a data source with * a degree of parallelism of one . * @ param data The collection of elements to create the data set from . * @ param type The TypeInformation for the produced data set . * @ return A DataSet representing the elements in the iterator . * @ see # fromCollection ( Iterator , Class ) */ public < X > DataSource < X > fromCollection ( Iterator < X > data , TypeInformation < X > type ) { } }
if ( ! ( data instanceof Serializable ) ) { throw new IllegalArgumentException ( "The iterator must be serializable." ) ; } return new DataSource < X > ( this , new IteratorInputFormat < X > ( data ) , type ) ;
public class ImplicitObjectELResolver { /** * If the base object is < code > null < / code > , and the property matches * the name of a JSP implicit object , returns < code > null < / code > to * indicate that no types are ever accepted to < code > setValue ( ) < / code > . * < p > The < code > propertyResolved < / code > property of the * < code > ELContext < / code > object must be set to < code > true < / code > by * this resolver before returning if an implicit object is matched . If * this property is not < code > true < / code > after this method is called , * the caller should ignore the return value . < / p > * @ param context The context of this evaluation . * @ param base Only < code > null < / code > is handled by this resolver . * Other values will result in an immediate return . * @ param property The name of the implicit object to resolve . * @ return If the < code > propertyResolved < / code > property of * < code > ELContext < / code > was set to < code > true < / code > , then * < code > null < / code > ; otherwise undefined . * @ throws NullPointerException if context is < code > null < / code > * @ throws ELException if an exception was thrown while performing * the property or variable resolution . The thrown exception * must be included as the cause property of this exception , if * available . */ public Class getType ( ELContext context , Object base , Object property ) { } }
if ( context == null ) { throw new NullPointerException ( ) ; } if ( ( base == null ) && ( "pageContext" . equals ( property ) || "pageScope" . equals ( property ) ) || "requestScope" . equals ( property ) || "sessionScope" . equals ( property ) || "applicationScope" . equals ( property ) || "param" . equals ( property ) || "paramValues" . equals ( property ) || "header" . equals ( property ) || "headerValues" . equals ( property ) || "initParam" . equals ( property ) || "cookie" . equals ( property ) ) { context . setPropertyResolved ( true ) ; } return null ;
public class Configuration { /** * Returns name of environment , such as " development " , " production " , etc . * This is a value that is usually setup with an environment variable < code > ACTIVE _ ENV < / code > . * @ return name of environment */ public static String getEnv ( ) { } }
if ( ENV == null ) { if ( ! blank ( System . getenv ( "ACTIVE_ENV" ) ) ) { ENV = System . getenv ( "ACTIVE_ENV" ) ; } if ( ! blank ( System . getProperty ( "ACTIVE_ENV" ) ) ) { ENV = System . getProperty ( "ACTIVE_ENV" ) ; } if ( ! blank ( System . getProperty ( "active_env" ) ) ) { ENV = System . getProperty ( "active_env" ) ; } if ( blank ( ENV ) ) { ENV = "development" ; LogFilter . log ( LOGGER , LogLevel . INFO , "Environment variable ACTIVE_ENV not provided, defaulting to '" + ENV + "'" ) ; } } return ENV ;
public class Route { /** * Generate Markdown documentation for this Route . */ public StringBuffer markdown ( Schema sinput , Schema soutput ) { } }
MarkdownBuilder builder = new MarkdownBuilder ( ) ; builder . comment ( "Preview with http://jbt.github.io/markdown-editor" ) ; builder . heading1 ( _http_method , _url ) ; builder . hline ( ) ; builder . paragraph ( _summary ) ; // parameters and output tables builder . heading1 ( "Input schema: " ) ; builder . append ( sinput . markdown ( true , false ) ) ; builder . heading1 ( "Output schema: " ) ; builder . append ( soutput . markdown ( false , true ) ) ; return builder . stringBuffer ( ) ;
public class FessMessages { /** * Add the created action message for the key ' errors . invalid _ query _ sort _ value ' with parameters . * < pre > * message : The given sort ( { 0 } ) is invalid . * < / pre > * @ param property The property name for the message . ( NotNull ) * @ param arg0 The parameter arg0 for message . ( NotNull ) * @ return this . ( NotNull ) */ public FessMessages addErrorsInvalidQuerySortValue ( String property , String arg0 ) { } }
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( ERRORS_invalid_query_sort_value , arg0 ) ) ; return this ;
public class IfcRelConnectsPathElementsImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < Long > getRelatedPriorities ( ) { } }
return ( EList < Long > ) eGet ( Ifc4Package . Literals . IFC_REL_CONNECTS_PATH_ELEMENTS__RELATED_PRIORITIES , true ) ;
public class DockerContainerObjectBuilder { /** * Specifies the list of enrichers that will be used to enrich the container object . * @ param enrichers * list of enrichers that will be used to enrich the container object * @ return the current builder instance */ public DockerContainerObjectBuilder < T > withEnrichers ( Collection < TestEnricher > enrichers ) { } }
if ( enrichers == null ) { throw new IllegalArgumentException ( "enrichers cannot be null" ) ; } this . enrichers = enrichers ; return this ;
public class FileSystemRecursiveIterator { /** * Override this method to manually filter the directories , which are recursed * into . * @ param aDirectory * The non - < code > null < / code > directory * @ return < code > true < / code > if all children of this directory should be * investigated */ @ OverrideOnDemand protected boolean recurseIntoDirectory ( @ Nonnull final File aDirectory ) { } }
return m_aRecursionFilter == null || m_aRecursionFilter . test ( aDirectory ) ;
public class JsonUnitResultMatchers { /** * Fails if selected JSON is null . */ public ResultMatcher isNotNull ( ) { } }
return new AbstractResultMatcher ( path , configuration ) { public void doMatch ( Object actual ) { isNotNull ( actual ) ; } } ;
public class DRL5Lexer { /** * $ ANTLR start " XOR _ ASSIGN " */ public final void mXOR_ASSIGN ( ) throws RecognitionException { } }
try { int _type = XOR_ASSIGN ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 180:5 : ( ' ^ = ' ) // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 180:7 : ' ^ = ' { match ( "^=" ) ; if ( state . failed ) return ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving }
public class CmsDriverManager { /** * Unsubscribes all deleted resources that were deleted before the specified time stamp . < p > * @ param dbc the database context * @ param poolName the name of the database pool to use * @ param deletedTo the time stamp to which the resources have been deleted * @ throws CmsException if something goes wrong */ public void unsubscribeAllDeletedResources ( CmsDbContext dbc , String poolName , long deletedTo ) throws CmsException { } }
getSubscriptionDriver ( ) . unsubscribeAllDeletedResources ( dbc , poolName , deletedTo ) ;
public class IsaTranslations { /** * FIXME Unhack result name extraction for implicit functions */ public String hackResultName ( AFuncDeclIR func ) throws AnalysisException { } }
SourceNode x = func . getSourceNode ( ) ; if ( x . getVdmNode ( ) instanceof AImplicitFunctionDefinition ) { AImplicitFunctionDefinition iFunc = ( AImplicitFunctionDefinition ) x . getVdmNode ( ) ; return iFunc . getResult ( ) . getPattern ( ) . toString ( ) ; } throw new AnalysisException ( "Expected AFuncDeclIR in implicit function source. Got: " + x . getVdmNode ( ) . getClass ( ) . toString ( ) ) ;
public class SystemUtils { /** * Sets if wifi data should be turned on or off . Requires android . permission . CHANGE _ WIFI _ STATE in the AndroidManifest . xml of the application under test . * @ param turnedOn true if mobile wifi is to be turned on and false if not */ public void setWiFiData ( Boolean turnedOn ) { } }
WifiManager wifiManager = ( WifiManager ) instrumentation . getTargetContext ( ) . getSystemService ( Context . WIFI_SERVICE ) ; try { wifiManager . setWifiEnabled ( turnedOn ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; }
public class IterableOfProtosSubject { /** * Excludes all message fields matching the given { @ link FieldDescriptor } s from the comparison . * < p > This method adds on any previous { @ link FieldScope } related settings , overriding previous * changes to ensure the specified fields are ignored recursively . All sub - fields of these field * descriptors are ignored , no matter where they occur in the tree . * < p > If a field descriptor which does not , or cannot occur in the proto structure is supplied , it * is silently ignored . */ public IterableOfProtosFluentAssertion < M > ignoringFieldDescriptors ( FieldDescriptor firstFieldDescriptor , FieldDescriptor ... rest ) { } }
return ignoringFieldDescriptors ( asList ( firstFieldDescriptor , rest ) ) ;
public class MenuDrawer { /** * Set the menu view to an explicit view . * @ param view The menu view . */ public void setMenuView ( View view ) { } }
setMenuView ( view , new LayoutParams ( LayoutParams . MATCH_PARENT , LayoutParams . MATCH_PARENT ) ) ;
public class XmlUtils { /** * Gets all the elements out of a { @ link NodeList } . * @ param nodeList the node list * @ return the elements */ public static List < Element > toElementList ( NodeList nodeList ) { } }
List < Element > elements = new ArrayList < Element > ( ) ; for ( int i = 0 ; i < nodeList . getLength ( ) ; i ++ ) { Node node = nodeList . item ( i ) ; if ( node instanceof Element ) { elements . add ( ( Element ) node ) ; } } return elements ;
public class BlackBox { public synchronized void insert_op ( int op ) { } }
// Insert elt in the box box [ insert_elt ] . req_type = Req_Operation ; box [ insert_elt ] . attr_type = Attr_Unknown ; box [ insert_elt ] . op_type = op ; box [ insert_elt ] . when = new Date ( ) ; // get client address get_client_host ( ) ; // manage insert and read indexes inc_indexes ( ) ;
public class LiveHelp { /** * The user has tabbed out * @ param id The id of the field that changed */ public void notifyBlur ( String id ) { } }
Util utilAll = new Util ( getUsersToAffect ( ) ) ; utilAll . removeClassName ( id , "disabled" ) ; utilAll . setValue ( id + "Tip" , "" ) ; // utilAll . addScript ( " $ ( ' " + id + " ' ) . disabled = false ; " ) ;
public class CognitiveServicesAccountsInner { /** * Returns all the resources of a particular type belonging to a subscription . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ return the { @ link ServiceFuture } object */ public ServiceFuture < List < CognitiveServicesAccountInner > > listAsync ( final ServiceCallback < List < CognitiveServicesAccountInner > > serviceCallback ) { } }
return ServiceFuture . fromResponse ( listWithServiceResponseAsync ( ) , serviceCallback ) ;
public class AudioRecorderImpl { /** * Fires specified event * @ param event the event to fire . */ private void fireEvent ( RecorderEventImpl event ) { } }
eventSender . event = event ; scheduler . submit ( eventSender , PriorityQueueScheduler . INPUT_QUEUE ) ;
public class IPAddressIntelligenceResponse { /** * Allowed ip address intelligence response . * @ return the ip address intelligence response */ public static IPAddressIntelligenceResponse allowed ( ) { } }
return builder ( ) . status ( IPAddressIntelligenceStatus . ALLOWED ) . score ( IPAddressIntelligenceStatus . ALLOWED . getScore ( ) ) . build ( ) ;
public class Inspector { /** * Get info about instance and class Methods that are dynamically added through Groovy . * @ return Array of StringArrays that can be indexed with the MEMBER _ xxx _ IDX constants */ public Object [ ] getMetaMethods ( ) { } }
MetaClass metaClass = InvokerHelper . getMetaClass ( objectUnderInspection ) ; List metaMethods = metaClass . getMetaMethods ( ) ; Object [ ] result = new Object [ metaMethods . size ( ) ] ; int i = 0 ; for ( Iterator iter = metaMethods . iterator ( ) ; iter . hasNext ( ) ; i ++ ) { MetaMethod metaMethod = ( MetaMethod ) iter . next ( ) ; result [ i ] = methodInfo ( metaMethod ) ; } return result ;
public class Strings { /** * Returns index of searchChar in cs with begin index { @ code start } * @ param searchChar * @ param start */ private static int indexOf ( CharSequence cs , CharSequence searchChar , int start ) { } }
return cs . toString ( ) . indexOf ( searchChar . toString ( ) , start ) ;
public class ModelsImpl { /** * Gets information about the closedlist models . * @ param appId The application ID . * @ param versionId The version ID . * @ param listClosedListsOptionalParameter the object representing the optional parameters to be set before calling this API * @ 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 List & lt ; ClosedListEntityExtractor & gt ; object if successful . */ public List < ClosedListEntityExtractor > listClosedLists ( UUID appId , String versionId , ListClosedListsOptionalParameter listClosedListsOptionalParameter ) { } }
return listClosedListsWithServiceResponseAsync ( appId , versionId , listClosedListsOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class SAX2DTM2 { /** * The optimized version of DTMDefaultBase . getTypedAttribute ( int , int ) . * Given a node handle and an expanded type ID , get the index of the node ' s * attribute of that type , if any . * @ param nodeHandle int Handle of the node . * @ param attType int expanded type ID of the required attribute . * @ return Handle of attribute of the required type , or DTM . NULL to indicate * none exists . */ protected final int getTypedAttribute ( int nodeHandle , int attType ) { } }
int nodeID = makeNodeIdentity ( nodeHandle ) ; if ( nodeID == DTM . NULL ) return DTM . NULL ; int type = _type2 ( nodeID ) ; if ( DTM . ELEMENT_NODE == type ) { int expType ; while ( true ) { nodeID ++ ; expType = _exptype2 ( nodeID ) ; if ( expType != DTM . NULL ) type = m_extendedTypes [ expType ] . getNodeType ( ) ; else return DTM . NULL ; if ( type == DTM . ATTRIBUTE_NODE ) { if ( expType == attType ) return makeNodeHandle ( nodeID ) ; } else if ( DTM . NAMESPACE_NODE != type ) { break ; } } } return DTM . NULL ;
public class FieldTable { /** * Get the next record ( return a null at EOF ) . * @ param iRelPosition The relative records to move . * @ return next FieldList or null if EOF . */ public FieldList move ( int iRelPosition ) throws DBException { } }
if ( ! m_bIsOpen ) this . open ( ) ; // This will requery the table the first time this . getRecord ( ) . setEditMode ( Constants . EDIT_NONE ) ; int iRecordStatus = this . doMove ( iRelPosition ) ; if ( iRecordStatus == Constants . NORMAL_RETURN ) { this . dataToFields ( this . getRecord ( ) ) ; // Usually , you would setDataSource ( null ) , but if in hasNext ( ) , you will need the dataSource . this . getRecord ( ) . setEditMode ( Constants . EDIT_CURRENT ) ; return m_record ; } else return null ; // Usually EOF
public class BoxWebLink { /** * Updates the information about this weblink with any info fields that have been modified locally . * < p > The only fields that will be updated are the ones that have been modified locally . For example , the following * code won ' t update any information ( or even send a network request ) since none of the info ' s fields were * changed : < / p > * < pre > BoxWebLink webLink = new BoxWebLink ( api , id ) ; * BoxWebLink . Info info = webLink . getInfo ( ) ; * webLink . updateInfo ( info ) ; < / pre > * @ param info the updated info . */ public void updateInfo ( BoxWebLink . Info info ) { } }
URL url = WEB_LINK_URL_TEMPLATE . build ( this . getAPI ( ) . getBaseURL ( ) , this . getID ( ) ) ; BoxJSONRequest request = new BoxJSONRequest ( this . getAPI ( ) , url , "PUT" ) ; request . setBody ( info . getPendingChanges ( ) ) ; String body = info . getPendingChanges ( ) ; BoxJSONResponse response = ( BoxJSONResponse ) request . send ( ) ; JsonObject jsonObject = JsonObject . readFrom ( response . getJSON ( ) ) ; info . update ( jsonObject ) ;
public class EFMImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . EFM__FM_NAME : return getFMName ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class ScreenServiceImpl { /** * { @ inheritDoc } */ @ Override public void saveScreenshot ( String screenName ) throws IOException { } }
logger . debug ( "saveScreenshot with the scenario named [{}]" , screenName ) ; final byte [ ] screenshot = ( ( TakesScreenshot ) Context . getDriver ( ) ) . getScreenshotAs ( OutputType . BYTES ) ; FileUtils . forceMkdir ( new File ( System . getProperty ( USER_DIR ) + File . separator + DOWNLOADED_FILES_FOLDER ) ) ; FileUtils . writeByteArrayToFile ( new File ( System . getProperty ( USER_DIR ) + File . separator + DOWNLOADED_FILES_FOLDER + File . separator + screenName + ".jpg" ) , screenshot ) ;
public class TreeUtil { /** * Retrieves the first WComponent by its path in the WComponent tree . See * { @ link # findWComponents ( WComponent , String [ ] ) } for a description of paths . * Searches only visible components . * @ param component the component to search from . * @ param path the path to the WComponent . * @ return the first component matching the given path , or null if not found . */ public static ComponentWithContext findWComponent ( final WComponent component , final String [ ] path ) { } }
return findWComponent ( component , path , true ) ;
public class Record { /** * Get value { @ link Byte } value * @ param label target label * @ return { @ link Byte } value of the label . If it is not null . */ public Byte getValueByte ( String label ) { } }
PrimitiveObject o = getPrimitiveObject ( VALUE , label , ObjectUtil . BYTE , "Byte" ) ; if ( o == null ) { return null ; } return ( Byte ) o . getObject ( ) ;
public class TupleGenerator { /** * Using selections from the given set of tuples , completes binding for all remaining variables . * Returns true if all variables have been bound . */ private boolean makeComplete ( TestCaseDef testCase , VarTupleSet tuples , List < VarDef > vars ) { } }
boolean complete ; // Test case still missing a required property ? if ( testCase . isSatisfied ( ) ) { // No , complete bindings for remaining variables complete = completeSatisfied ( testCase , tuples , vars ) ; } else { // Yes , find tuples that contain satisfying bindings . int prevBindings = testCase . getBindingCount ( ) ; Iterator < Tuple > satisfyingTuples = getSatisfyingTuples ( testCase , tuples ) ; for ( complete = false ; satisfyingTuples . hasNext ( ) && ! ( // Does this tuple lead to satisfaction of all current test case conditions ? makeSatisfied ( testCase , tuples , satisfyingTuples . next ( ) ) // Can we complete bindings for remaining variables ? && ( complete = completeSatisfied ( testCase , tuples , vars ) ) ) ; // No , try next tuple testCase . revertBindings ( prevBindings ) ) ; } return complete ;
public class Assertions { /** * Assert that value is not null * @ param < T > type of the object to check * @ param failMessage the message to be provided as error description , can be null * @ param object the object to check * @ return the same input parameter if all is ok * @ throws AssertionError it will be thrown if the value is null * @ since 1.1.0 */ @ Nonnull public static < T > T assertNotNull ( @ Nullable final String failMessage , @ Nullable final T object ) { } }
if ( object == null ) { final String txt = failMessage == null ? "Object must not be NULL" : failMessage ; final AssertionError error = new AssertionError ( txt ) ; MetaErrorListeners . fireError ( txt , error ) ; throw error ; } return object ;
public class CmsSecureExportDialog { /** * Fills the selection widget with the options ' True ' , ' False ' and ' Not set ' . < p > * @ param optGroup the option group to initialize */ private void initOptionGroup ( OptionGroup optGroup ) { } }
optGroup . addStyleName ( ValoTheme . OPTIONGROUP_HORIZONTAL ) ; optGroup . setNullSelectionAllowed ( false ) ; optGroup . addItem ( "true" ) ; optGroup . addItem ( "false" ) ; optGroup . addItem ( "" ) ; CmsWorkplaceMessages wpMessages = OpenCms . getWorkplaceManager ( ) . getMessages ( A_CmsUI . get ( ) . getLocale ( ) ) ; optGroup . setItemCaption ( "true" , wpMessages . key ( org . opencms . workplace . commons . Messages . GUI_LABEL_TRUE_0 ) ) ; optGroup . setItemCaption ( "false" , wpMessages . key ( org . opencms . workplace . commons . Messages . GUI_LABEL_FALSE_0 ) ) ; optGroup . setItemCaption ( "" , wpMessages . key ( org . opencms . workplace . commons . Messages . GUI_SECURE_NOT_SET_0 ) ) ;
public class ApiOvhDbaaslogs { /** * Get a public temporary URL to access the archive * REST : POST / dbaas / logs / { serviceName } / output / graylog / stream / { streamId } / archive / { archiveId } / url * @ param serviceName [ required ] Service name * @ param streamId [ required ] Stream ID * @ param archiveId [ required ] Archive ID */ public OvhArchiveUrl serviceName_output_graylog_stream_streamId_archive_archiveId_url_POST ( String serviceName , String streamId , String archiveId ) throws IOException { } }
String qPath = "/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}/url" ; StringBuilder sb = path ( qPath , serviceName , streamId , archiveId ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhArchiveUrl . class ) ;
public class TreeWriter { /** * Add the links to all the package tree files . * @ param contentTree the content tree to which the links will be added */ protected void addPackageTreeLinks ( Content contentTree ) { } }
// Do nothing if only unnamed package is used if ( isUnnamedPackage ( ) ) { return ; } if ( ! classesOnly ) { Content span = HtmlTree . SPAN ( HtmlStyle . packageHierarchyLabel , contents . packageHierarchies ) ; contentTree . addContent ( span ) ; HtmlTree ul = new HtmlTree ( HtmlTag . UL ) ; ul . addStyle ( HtmlStyle . horizontal ) ; int i = 0 ; for ( PackageElement pkg : packages ) { // If the package name length is 0 or if - nodeprecated option // is set and the package is marked as deprecated , do not include // the page in the list of package hierarchies . if ( pkg . isUnnamed ( ) || ( configuration . nodeprecated && utils . isDeprecated ( pkg ) ) ) { i ++ ; continue ; } DocPath link = pathString ( pkg , DocPaths . PACKAGE_TREE ) ; Content li = HtmlTree . LI ( getHyperLink ( link , new StringContent ( utils . getPackageName ( pkg ) ) ) ) ; if ( i < packages . size ( ) - 1 ) { li . addContent ( ", " ) ; } ul . addContent ( li ) ; i ++ ; } contentTree . addContent ( ul ) ; }
public class GroovyShell { /** * Runs the given script source with command line arguments * @ param source is the source content of the script * @ param args the command line arguments to pass in */ public Object run ( URI source , String [ ] args ) throws CompilationFailedException , IOException { } }
return run ( new GroovyCodeSource ( source ) , args ) ;
public class InstanceTemplateClient { /** * Returns the specified instance template . Gets a list of available instance templates by making * a list ( ) request . * < p > Sample code : * < pre > < code > * try ( InstanceTemplateClient instanceTemplateClient = InstanceTemplateClient . create ( ) ) { * ProjectGlobalInstanceTemplateName instanceTemplate = ProjectGlobalInstanceTemplateName . of ( " [ PROJECT ] " , " [ INSTANCE _ TEMPLATE ] " ) ; * InstanceTemplate response = instanceTemplateClient . getInstanceTemplate ( instanceTemplate ) ; * < / code > < / pre > * @ param instanceTemplate The name of the instance template . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi public final InstanceTemplate getInstanceTemplate ( ProjectGlobalInstanceTemplateName instanceTemplate ) { } }
GetInstanceTemplateHttpRequest request = GetInstanceTemplateHttpRequest . newBuilder ( ) . setInstanceTemplate ( instanceTemplate == null ? null : instanceTemplate . toString ( ) ) . build ( ) ; return getInstanceTemplate ( request ) ;
public class CameraUtil { /** * Calculate the FOV of camera , using focalLength and sensorWidth * @ param focalLength * @ param sensorWidth * @ return FOV */ public static float fieldOfView ( float focalLength , float sensorWidth ) { } }
double fov = 2 * Math . atan ( .5 * sensorWidth / focalLength ) ; return ( float ) Math . toDegrees ( fov ) ;
public class ByteArray { /** * Creates a { @ code ByteArray } object given a string . The string is encoded in { @ code UTF - 8 } . The * bytes are copied . */ public static final ByteArray copyFrom ( String string ) { } }
return new ByteArray ( ByteString . copyFrom ( string , StandardCharsets . UTF_8 ) ) ;
public class StandardAccessManager { /** * Creates and registers a session . * @ param defaultUserSettings * @ return */ public StandardSession createSession ( Properties defaultUserSettings ) { } }
StandardSession session = new StandardSession ( this , sessionTimeout , defaultUserSettings ) ; synchronized ( sessions ) { synchronized ( sessionsMirror ) { sessions . put ( session . getToken ( ) , session ) ; sessionsMirror . put ( session . getToken ( ) , session ) ; } } System . out . println ( new LogEntry ( "session " + session + " created" ) ) ; return session ;
public class ListRateBasedRulesResult { /** * An array of < a > RuleSummary < / a > objects . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setRules ( java . util . Collection ) } or { @ link # withRules ( java . util . Collection ) } if you want to override the * existing values . * @ param rules * An array of < a > RuleSummary < / a > objects . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListRateBasedRulesResult withRules ( RuleSummary ... rules ) { } }
if ( this . rules == null ) { setRules ( new java . util . ArrayList < RuleSummary > ( rules . length ) ) ; } for ( RuleSummary ele : rules ) { this . rules . add ( ele ) ; } return this ;
public class LongTuples { /** * Lexicographically increment the given tuple in the given range , and * store the result in the given result tuple . It is assumed that the * elements of the given tuple are * { @ link # areElementsGreaterThanOrEqual ( LongTuple , LongTuple ) greater than * or equal to } the values in the given minimum tuple . < br > * < br > * Note that in contrast to most other methods in this class , the * given result tuple may < b > not < / b > be < code > null < / code > ( but it * may be identical to the input tuple ) . * @ param t The input tuple * @ param min The minimum values * @ param max The maximum values * @ param result The result tuple * @ return Whether the tuple could be incremented without causing an * overflow */ public static boolean incrementLexicographically ( LongTuple t , LongTuple min , LongTuple max , MutableLongTuple result ) { } }
Utils . checkForEqualSize ( t , min ) ; Utils . checkForEqualSize ( t , max ) ; Utils . checkForEqualSize ( t , result ) ; if ( result != t ) { result . set ( t ) ; } return incrementLexicographically ( result , min , max , result . getSize ( ) - 1 ) ;
public class DirectoryWatcher { /** * 为指定目录注册监控事件 * @ param path */ private void registerDirectory ( Path path ) { } }
try { LOGGER . info ( "监控目录:" + path ) ; WatchKey key = path . register ( watchService , events ) ; directories . put ( key , path ) ; } catch ( IOException ex ) { LOGGER . error ( "监控目录失败:" + path . toAbsolutePath ( ) , ex ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcShapeAspect ( ) { } }
if ( ifcShapeAspectEClass == null ) { ifcShapeAspectEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 595 ) ; } return ifcShapeAspectEClass ;
public class StringHelper { /** * Optimized remove method that removes a set of characters from an input * string ! * @ param sInputString * The input string . * @ param aRemoveChars * The characters to remove . May not be < code > null < / code > . * @ return The version of the string without the passed characters or an empty * String if the input string was < code > null < / code > . */ @ Nonnull public static String removeMultiple ( @ Nullable final String sInputString , @ Nonnull final char [ ] aRemoveChars ) { } }
ValueEnforcer . notNull ( aRemoveChars , "RemoveChars" ) ; // Any input text ? if ( hasNoText ( sInputString ) ) return "" ; // Anything to remove ? if ( aRemoveChars . length == 0 ) return sInputString ; final StringBuilder aSB = new StringBuilder ( sInputString . length ( ) ) ; iterateChars ( sInputString , cInput -> { if ( ! ArrayHelper . contains ( aRemoveChars , cInput ) ) aSB . append ( cInput ) ; } ) ; return aSB . toString ( ) ;
public class DefaultGroovyMethods { /** * Iterates over the collection of items and returns each item that matches * the given filter - calling the < code > { @ link # isCase ( java . lang . Object , java . lang . Object ) } < / code > * method used by switch statements . This method can be used with different * kinds of filters like regular expressions , classes , ranges etc . * Example : * < pre class = " groovyTestCase " > * def set = [ ' a ' , ' b ' , ' aa ' , ' bc ' , 3 , 4.5 ] as Set * assert set . grep ( ~ / a + / ) = = [ ' a ' , ' aa ' ] as Set * assert set . grep ( ~ / . . / ) = = [ ' aa ' , ' bc ' ] as Set * assert set . grep ( Number ) = = [ 3 , 4.5 ] as Set * assert set . grep { it . toString ( ) . size ( ) = = 1 } = = [ ' a ' , ' b ' , 3 ] as Set * < / pre > * @ param self a Set * @ param filter the filter to perform on each element of the collection ( using the { @ link # isCase ( java . lang . Object , java . lang . Object ) } method ) * @ return a Set of objects which match the filter * @ since 2.4.0 */ public static < T > Set < T > grep ( Set < T > self , Object filter ) { } }
return ( Set < T > ) grep ( ( Collection < T > ) self , filter ) ;
public class PdfContentByte { /** * Changes the value of the < VAR > line dash pattern < / VAR > . * The line dash pattern controls the pattern of dashes and gaps used to stroke paths . * It is specified by an < I > array < / I > and a < I > phase < / I > . The array specifies the length * of the alternating dashes and gaps . The phase specifies the distance into the dash * pattern to start the dash . < BR > * @ param phase the value of the phase * @ param unitsOn the number of units that must be ' on ' ( equals the number of units that must be ' off ' ) . */ public void setLineDash ( float unitsOn , float phase ) { } }
content . append ( "[" ) . append ( unitsOn ) . append ( "] " ) . append ( phase ) . append ( " d" ) . append_i ( separator ) ;
public class HttpStatusCodeException { /** * Return the response body as a byte array . * @ since 3.0.5 */ public byte [ ] getResponseBodyAsByteArray ( ) { } }
final ByteBuf bodyByteBuf = httpInputMessage . getBody ( ) ; final byte [ ] bytes = new byte [ bodyByteBuf . readableBytes ( ) ] ; bodyByteBuf . readBytes ( bytes ) ; return bytes ;
public class MappedClass { /** * Returns the first found Annotation , or null . * @ param clazz The Annotation to find . * @ return First found Annotation or null of none found . */ public Annotation getFirstAnnotation ( final Class < ? extends Annotation > clazz ) { } }
final List < Annotation > found = foundAnnotations . get ( clazz ) ; return found == null || found . isEmpty ( ) ? null : found . get ( 0 ) ;
public class Command { /** * Build the body for request * @ param method * @ return */ private byte [ ] getBody ( String method ) { } }
byte [ ] body = null ; String methodsWithInputEntity = HttpMethod . POST . name ( ) + "|" + HttpMethod . PUT . name ( ) + "|" + HttpMethod . DELETE . name ( ) ; if ( method . matches ( methodsWithInputEntity ) ) { if ( isCompound ( ) ) { body = Utils . toBytes ( getQueryInputEntity ( ) ) ; } else { if ( metadataJson . containsKey ( INPUT_ENTITY ) ) { JSONable data = ( JSONable ) commandParams . get ( metadataJson . getString ( INPUT_ENTITY ) ) ; if ( data != null ) { body = Utils . toBytes ( data . toJSON ( ) ) ; } } } } return body ;
public class JToggle { /** * Set the up indicator to display when the drawer indicator is not * enabled . * If you pass 0 to this method , the default drawable from the theme will * be used . * @ param resId Resource ID of a drawable to use for the up indicator , or 0 * to use the theme ' s default * @ see # setDrawerIndicatorEnabled ( boolean ) */ public void setHomeAsUpIndicator ( int resId ) { } }
Drawable indicator = null ; if ( resId != 0 ) { indicator = mDrawerLayout . getResources ( ) . getDrawable ( resId ) ; } setHomeAsUpIndicator ( indicator ) ;
public class ResourceUtils { /** * Returns a string from the specified Reader object . * @ param reader the reader * @ return the string * @ throws IOException if an error occurred when reading resources using any I / O operations */ public static String read ( Reader reader ) throws IOException { } }
final char [ ] buffer = new char [ 1024 ] ; StringBuilder sb = new StringBuilder ( ) ; int len ; while ( ( len = reader . read ( buffer ) ) != - 1 ) { sb . append ( buffer , 0 , len ) ; } return sb . toString ( ) ;
public class FileExecutor { /** * 扫描文件夹下面所有文件 * @ param folder 文件夹 * @ return 文件路径列表 */ public static List < String > scanFolder ( File folder ) { } }
String parent = folder . getAbsolutePath ( ) + ValueConsts . SEPARATOR ; List < String > list = new ArrayList < > ( 16 ) ; if ( folder . isDirectory ( ) ) { String [ ] children = folder . list ( ) ; if ( Checker . isNotNull ( children ) ) { for ( String child : children ) { File file = new File ( parent + child ) ; if ( file . isDirectory ( ) ) { list . addAll ( scanFolder ( file ) ) ; } else { list . add ( file . getAbsolutePath ( ) ) ; } } } } return list ;
public class SecurityContext { /** * Return the accessid of the current subject on the thread * @ return the access id , or null if there is no subject or no WSCredential */ public static String getUser ( ) { } }
String accessid = null ; WSCredential credential = getCallerWSCredential ( ) ; try { if ( credential != null && ! credential . isUnauthenticated ( ) ) accessid = credential . getAccessId ( ) ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Internal error: " + e ) ; } return accessid ;
public class DerefQuery { /** * { @ inheritDoc } */ @ Override public Query rewrite ( IndexReader reader ) throws IOException { } }
Query cQuery = contextQuery . rewrite ( reader ) ; if ( cQuery == contextQuery ) // NOSONAR { return this ; } else { return new DerefQuery ( cQuery , refProperty , nameTest , version , nsMappings ) ; }
public class FaceletViewDeclarationLanguage { /** * In short words , this method take care of " target " an " attached object " . * < ul > * < li > The " attached object " is instantiated by a tag handler . < / li > * < li > The " target " is an object used as " marker " , that exposes a List < UIComponent > < / li > * < / ul > * This method should be called from some composite component tag handler , after * all children of composite component has been applied . */ @ Override @ SuppressWarnings ( "unchecked" ) public void retargetAttachedObjects ( FacesContext context , UIComponent topLevelComponent , List < AttachedObjectHandler > handlerList ) { } }
checkNull ( context , "context" ) ; checkNull ( topLevelComponent , "topLevelComponent" ) ; checkNull ( handlerList , "handlerList" ) ; BeanInfo compositeComponentMetadata = ( BeanInfo ) topLevelComponent . getAttributes ( ) . get ( UIComponent . BEANINFO_KEY ) ; if ( compositeComponentMetadata == null ) { log . severe ( "Composite component metadata not found for: " + topLevelComponent . getClientId ( context ) ) ; return ; } BeanDescriptor compositeComponentDescriptor = compositeComponentMetadata . getBeanDescriptor ( ) ; List < AttachedObjectTarget > targetList = ( List < AttachedObjectTarget > ) compositeComponentDescriptor . getValue ( AttachedObjectTarget . ATTACHED_OBJECT_TARGETS_KEY ) ; if ( targetList == null || targetList . isEmpty ( ) ) { return ; } for ( int i = 0 , size = handlerList . size ( ) ; i < size ; i ++ ) { AttachedObjectHandler currentHandler = handlerList . get ( i ) ; // In the spec javadoc this variable is referred as forAttributeValue , but // note it is also called curTargetName String forValue = currentHandler . getFor ( ) ; // perf : targetList is always arrayList : see AttachedObjectTargetHandler . apply // and ClientBehaviorHandler . apply for ( int k = 0 , targetsSize = targetList . size ( ) ; k < targetsSize ; k ++ ) { AttachedObjectTarget currentTarget = targetList . get ( k ) ; FaceletCompositionContext mctx = FaceletCompositionContext . getCurrentInstance ( ) ; if ( ( forValue != null && forValue . equals ( currentTarget . getName ( ) ) ) && ( ( currentTarget instanceof ActionSource2AttachedObjectTarget && currentHandler instanceof ActionSource2AttachedObjectHandler ) || ( currentTarget instanceof EditableValueHolderAttachedObjectTarget && currentHandler instanceof EditableValueHolderAttachedObjectHandler ) || ( currentTarget instanceof ValueHolderAttachedObjectTarget && currentHandler instanceof ValueHolderAttachedObjectHandler ) ) ) { // perf : getTargets return ArrayList - see getTargets implementations List < UIComponent > targets = currentTarget . getTargets ( topLevelComponent ) ; for ( int l = 0 , targetsCount = targets . size ( ) ; l < targetsCount ; l ++ ) { UIComponent component = targets . get ( l ) ; // If we found composite components when traverse the tree // we have to call this one recursively , because each composite component // should have its own AttachedObjectHandler list , filled earlier when // its tag handler is applied . if ( UIComponent . isCompositeComponent ( component ) ) { // How we obtain the list of AttachedObjectHandler for // the current composite component ? It should be a component // attribute or retrieved by a key inside component . getAttributes // map . Since api does not specify any attribute , we suppose // this is an implementation detail and it should be retrieved // from component attribute map . // But this is only the point of the iceberg , because we should // define how we register attached object handlers in this list . // ANS : see CompositeComponentResourceTagHandler . // The current handler should be added to the list , to be chained . // Note that the inner component should have a target with the same name // as " for " attribute mctx . addAttachedObjectHandler ( component , currentHandler ) ; List < AttachedObjectHandler > handlers = mctx . getAttachedObjectHandlers ( component ) ; retargetAttachedObjects ( context , component , handlers ) ; handlers . remove ( currentHandler ) ; } else { currentHandler . applyAttachedObject ( context , component ) ; } if ( mctx . isUsingPSSOnThisView ( ) && mctx . isMarkInitialState ( ) ) { component . markInitialState ( ) ; } } } else if ( ( currentTarget instanceof BehaviorHolderAttachedObjectTarget && currentHandler instanceof BehaviorHolderAttachedObjectHandler ) ) { String eventName = ( ( BehaviorHolderAttachedObjectHandler ) currentHandler ) . getEventName ( ) ; boolean isDefaultEvent = ( ( BehaviorHolderAttachedObjectTarget ) currentTarget ) . isDefaultEvent ( ) ; if ( ( eventName != null && eventName . equals ( currentTarget . getName ( ) ) ) || ( eventName == null && isDefaultEvent ) ) { List < UIComponent > targets = currentTarget . getTargets ( topLevelComponent ) ; for ( int j = 0 , targetssize = targets . size ( ) ; j < targetssize ; j ++ ) { UIComponent component = targets . get ( j ) ; // If we found composite components when traverse the tree // we have to call this one recursively , because each composite component // should have its own AttachedObjectHandler list , filled earlier when // its tag handler is applied . if ( UIComponent . isCompositeComponent ( component ) ) { if ( currentTarget instanceof ClientBehaviorAttachedObjectTarget ) { mctx . addAttachedObjectHandler ( component , new ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper ( ( BehaviorHolderAttachedObjectHandler ) currentHandler , ( ( ClientBehaviorAttachedObjectTarget ) currentTarget ) . getEvent ( ) ) ) ; } else { mctx . addAttachedObjectHandler ( component , currentHandler ) ; } List < AttachedObjectHandler > handlers = mctx . getAttachedObjectHandlers ( component ) ; retargetAttachedObjects ( context , component , handlers ) ; handlers . remove ( currentHandler ) ; } else { if ( currentHandler instanceof ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper ) { currentHandler . applyAttachedObject ( context , new ClientBehaviorRedirectEventComponentWrapper ( component , ( ( ClientBehaviorRedirectBehaviorAttachedObjectHandlerWrapper ) currentHandler ) . getWrappedEventName ( ) , eventName ) ) ; } else { currentHandler . applyAttachedObject ( context , component ) ; } } if ( mctx . isUsingPSSOnThisView ( ) && mctx . isMarkInitialState ( ) ) { component . markInitialState ( ) ; } } } } } }
public class GetPendingJobExecutionsResult { /** * A list of JobExecutionSummary objects with status IN _ PROGRESS . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setInProgressJobs ( java . util . Collection ) } or { @ link # withInProgressJobs ( java . util . Collection ) } if you want * to override the existing values . * @ param inProgressJobs * A list of JobExecutionSummary objects with status IN _ PROGRESS . * @ return Returns a reference to this object so that method calls can be chained together . */ public GetPendingJobExecutionsResult withInProgressJobs ( JobExecutionSummary ... inProgressJobs ) { } }
if ( this . inProgressJobs == null ) { setInProgressJobs ( new java . util . ArrayList < JobExecutionSummary > ( inProgressJobs . length ) ) ; } for ( JobExecutionSummary ele : inProgressJobs ) { this . inProgressJobs . add ( ele ) ; } return this ;
public class MultiDateFormat { /** * We have a non - null date , try each format in turn to see if it can be parsed . * @ param str date to parse * @ param pos position at which to start parsing * @ return Date instance */ protected Date parseNonNullDate ( String str , ParsePosition pos ) { } }
Date result = null ; for ( int index = 0 ; index < m_formats . length ; index ++ ) { result = m_formats [ index ] . parse ( str , pos ) ; if ( pos . getIndex ( ) != 0 ) { break ; } result = null ; } return result ;
public class RouteFilterRulesInner { /** * Creates or updates a route in the specified route filter . * @ param resourceGroupName The name of the resource group . * @ param routeFilterName The name of the route filter . * @ param ruleName The name of the route filter rule . * @ param routeFilterRuleParameters Parameters supplied to the create or update route filter rule operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable for the request */ public Observable < RouteFilterRuleInner > createOrUpdateAsync ( String resourceGroupName , String routeFilterName , String ruleName , RouteFilterRuleInner routeFilterRuleParameters ) { } }
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , routeFilterName , ruleName , routeFilterRuleParameters ) . map ( new Func1 < ServiceResponse < RouteFilterRuleInner > , RouteFilterRuleInner > ( ) { @ Override public RouteFilterRuleInner call ( ServiceResponse < RouteFilterRuleInner > response ) { return response . body ( ) ; } } ) ;
public class WebcamDefaultDevice { /** * Start underlying frames refresher . * @ return Refresher thread */ private Thread startFramesRefresher ( ) { } }
Thread refresher = new Thread ( this , String . format ( "frames-refresher-[%s]" , id ) ) ; refresher . setUncaughtExceptionHandler ( WebcamExceptionHandler . getInstance ( ) ) ; refresher . setDaemon ( true ) ; refresher . start ( ) ; return refresher ;